Download packages/ai/src/errors.ts from Atmint/cpns: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/spaces/Atmint/cpns/resolve/main/packages/ai/src/errors.ts
- Command line
-
hf download hf://spaces/Atmint/cpns/packages/ai/src/errors.ts
-
curl -L -o errors.ts https://huggingface.co/spaces/Atmint/cpns/resolve/main/packages/ai/src/errors.ts
523 Bytes
| /** | |
| * Custom error thrown when AI generation fails part-way through. | |
| * Carries `tokensUsed` so the caller can record consumed tokens even on failure. | |
| */ | |
| export class GenerationError extends Error { | |
| tokensUsed?: number; | |
| partialResult?: { questions: unknown[] }; | |
| constructor(message: string, opts?: { tokensUsed?: number; partialResult?: { questions: unknown[] } }) { | |
| super(message); | |
| this.name = "GenerationError"; | |
| this.tokensUsed = opts?.tokensUsed; | |
| this.partialResult = opts?.partialResult; | |
| } | |
| } | |