Spaces:
Sleeping
Sleeping
Download backend/src/lib/inference/errors.ts from bardd/mike-backend: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/spaces/bardd/mike-backend/resolve/main/backend/src/lib/inference/errors.ts
- Command line
-
hf download hf://spaces/bardd/mike-backend/backend/src/lib/inference/errors.ts
-
curl -L -o errors.ts https://huggingface.co/spaces/bardd/mike-backend/resolve/main/backend/src/lib/inference/errors.ts
1.33 kB
| import type { InferenceProviderId } from "./types"; | |
| export class ProviderModelMismatchError extends Error { | |
| readonly code = "provider_model_mismatch" as const; | |
| constructor(message = "provider_model_mismatch") { | |
| super(message); | |
| this.name = "ProviderModelMismatchError"; | |
| } | |
| } | |
| export class MissingApiKeyError extends Error { | |
| readonly code = "missing_api_key" as const; | |
| readonly provider: InferenceProviderId; | |
| constructor(provider: InferenceProviderId) { | |
| super(`missing_api_key:${provider}`); | |
| this.name = "MissingApiKeyError"; | |
| this.provider = provider; | |
| } | |
| } | |
| export class VertexNotConfiguredError extends Error { | |
| readonly code = "vertex_not_configured" as const; | |
| readonly missingEnvVars: string[]; | |
| constructor(missingEnvVars: string[]) { | |
| super( | |
| `Vertex AI provider not configured. Missing: ${missingEnvVars.join(", ")}`, | |
| ); | |
| this.name = "VertexNotConfiguredError"; | |
| this.missingEnvVars = missingEnvVars; | |
| } | |
| } | |
| export class InferenceManifestValidationError extends Error { | |
| readonly issues: string[]; | |
| constructor(issues: string[]) { | |
| super(`Invalid inference manifest:\n- ${issues.join("\n- ")}`); | |
| this.name = "InferenceManifestValidationError"; | |
| this.issues = issues; | |
| } | |
| } | |