Spaces:
Runtime error
Runtime error
Download sdk-js/examples/error-handling.ts from horribleProgram/IntentAPI: direct link, hf CLI and curl.
- Browser
- Download file 280 Bytes
-
https://huggingface.co/spaces/horribleProgram/IntentAPI/resolve/main/sdk-js/examples/error-handling.ts
- Command line
-
hf download hf://spaces/horribleProgram/IntentAPI/sdk-js/examples/error-handling.ts
-
curl -L -o error-handling.ts https://huggingface.co/spaces/horribleProgram/IntentAPI/resolve/main/sdk-js/examples/error-handling.ts
280 Bytes
| import { query_intent } from "../src/index.ts"; | |
| try { | |
| const result = await query_intent("I want to add an item to my shopping list"); | |
| console.log(`${result.intent} (${result.confidence})`); | |
| } catch (err) { | |
| console.error("Classification failed:", (err as Error).message); | |
| } | |