@ai-sdk/provider
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -32,2 +32,4 @@ "use strict"; | ||
LoadAPIKeyError: () => LoadAPIKeyError, | ||
LoadSettingError: () => LoadSettingError, | ||
NoContentGeneratedError: () => NoContentGeneratedError, | ||
NoObjectGeneratedError: () => NoObjectGeneratedError, | ||
@@ -291,9 +293,47 @@ NoSuchToolError: () => NoSuchToolError, | ||
// src/errors/load-setting-error.ts | ||
var LoadSettingError = class extends Error { | ||
constructor({ message }) { | ||
super(message); | ||
this.name = "AI_LoadSettingError"; | ||
} | ||
static isLoadSettingError(error) { | ||
return error instanceof Error && error.name === "AI_LoadSettingError"; | ||
} | ||
toJSON() { | ||
return { | ||
name: this.name, | ||
message: this.message | ||
}; | ||
} | ||
}; | ||
// src/errors/no-content-generated-error.ts | ||
var NoContentGeneratedError = class extends Error { | ||
constructor({ | ||
message = "No content generated." | ||
} = {}) { | ||
super(message); | ||
this.name = "AI_NoContentGeneratedError"; | ||
} | ||
static isNoContentGeneratedError(error) { | ||
return error instanceof Error && error.name === "AI_NoContentGeneratedError"; | ||
} | ||
toJSON() { | ||
return { | ||
name: this.name, | ||
cause: this.cause, | ||
message: this.message, | ||
stack: this.stack | ||
}; | ||
} | ||
}; | ||
// src/errors/no-object-generated-error.ts | ||
var NoObjectGeneratedError = class extends Error { | ||
constructor() { | ||
super(`No object generated.`); | ||
constructor({ message = "No object generated." } = {}) { | ||
super(message); | ||
this.name = "AI_NoObjectGeneratedError"; | ||
} | ||
static isNoTextGeneratedError(error) { | ||
static isNoObjectGeneratedError(error) { | ||
return error instanceof Error && error.name === "AI_NoObjectGeneratedError"; | ||
@@ -502,2 +542,4 @@ } | ||
LoadAPIKeyError, | ||
LoadSettingError, | ||
NoContentGeneratedError, | ||
NoObjectGeneratedError, | ||
@@ -504,0 +546,0 @@ NoSuchToolError, |
@@ -241,6 +241,39 @@ import { JSONSchema7 } from 'json-schema'; | ||
declare class LoadSettingError extends Error { | ||
constructor({ message }: { | ||
message: string; | ||
}); | ||
static isLoadSettingError(error: unknown): error is LoadSettingError; | ||
toJSON(): { | ||
name: string; | ||
message: string; | ||
}; | ||
} | ||
/** | ||
Thrown when the AI provider fails to generate any content. | ||
*/ | ||
declare class NoContentGeneratedError extends Error { | ||
readonly cause: unknown; | ||
constructor({ message, }?: { | ||
message?: string; | ||
}); | ||
static isNoContentGeneratedError(error: unknown): error is NoContentGeneratedError; | ||
toJSON(): { | ||
name: string; | ||
cause: unknown; | ||
message: string; | ||
stack: string | undefined; | ||
}; | ||
} | ||
/** | ||
Thrown when the AI provider fails to generate a parsable object. | ||
*/ | ||
declare class NoObjectGeneratedError extends Error { | ||
readonly cause: unknown; | ||
constructor(); | ||
static isNoTextGeneratedError(error: unknown): error is NoObjectGeneratedError; | ||
constructor({ message }?: { | ||
message?: string; | ||
}); | ||
static isNoObjectGeneratedError(error: unknown): error is NoObjectGeneratedError; | ||
toJSON(): { | ||
@@ -776,2 +809,2 @@ name: string; | ||
export { APICallError, type EmbeddingModelV1, type EmbeddingModelV1Embedding, EmptyResponseBodyError, InvalidArgumentError, InvalidDataContentError, InvalidPromptError, InvalidResponseDataError, InvalidToolArgumentsError, JSONParseError, type LanguageModelV1, type LanguageModelV1CallOptions, type LanguageModelV1CallWarning, type LanguageModelV1FinishReason, type LanguageModelV1FunctionTool, type LanguageModelV1FunctionToolCall, type LanguageModelV1ImagePart, type LanguageModelV1LogProbs, type LanguageModelV1Message, type LanguageModelV1Prompt, type LanguageModelV1ResponseMetadata, type LanguageModelV1StreamPart, type LanguageModelV1TextPart, type LanguageModelV1ToolCallPart, type LanguageModelV1ToolResultPart, LoadAPIKeyError, NoObjectGeneratedError, NoSuchToolError, RetryError, type RetryErrorReason, TooManyEmbeddingValuesForCallError, ToolCallParseError, TypeValidationError, UnsupportedFunctionalityError, UnsupportedJSONSchemaError }; | ||
export { APICallError, type EmbeddingModelV1, type EmbeddingModelV1Embedding, EmptyResponseBodyError, InvalidArgumentError, InvalidDataContentError, InvalidPromptError, InvalidResponseDataError, InvalidToolArgumentsError, JSONParseError, type LanguageModelV1, type LanguageModelV1CallOptions, type LanguageModelV1CallWarning, type LanguageModelV1FinishReason, type LanguageModelV1FunctionTool, type LanguageModelV1FunctionToolCall, type LanguageModelV1ImagePart, type LanguageModelV1LogProbs, type LanguageModelV1Message, type LanguageModelV1Prompt, type LanguageModelV1ResponseMetadata, type LanguageModelV1StreamPart, type LanguageModelV1TextPart, type LanguageModelV1ToolCallPart, type LanguageModelV1ToolResultPart, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoObjectGeneratedError, NoSuchToolError, RetryError, type RetryErrorReason, TooManyEmbeddingValuesForCallError, ToolCallParseError, TypeValidationError, UnsupportedFunctionalityError, UnsupportedJSONSchemaError }; |
@@ -32,2 +32,4 @@ "use strict"; | ||
LoadAPIKeyError: () => LoadAPIKeyError, | ||
LoadSettingError: () => LoadSettingError, | ||
NoContentGeneratedError: () => NoContentGeneratedError, | ||
NoObjectGeneratedError: () => NoObjectGeneratedError, | ||
@@ -291,9 +293,47 @@ NoSuchToolError: () => NoSuchToolError, | ||
// src/errors/load-setting-error.ts | ||
var LoadSettingError = class extends Error { | ||
constructor({ message }) { | ||
super(message); | ||
this.name = "AI_LoadSettingError"; | ||
} | ||
static isLoadSettingError(error) { | ||
return error instanceof Error && error.name === "AI_LoadSettingError"; | ||
} | ||
toJSON() { | ||
return { | ||
name: this.name, | ||
message: this.message | ||
}; | ||
} | ||
}; | ||
// src/errors/no-content-generated-error.ts | ||
var NoContentGeneratedError = class extends Error { | ||
constructor({ | ||
message = "No content generated." | ||
} = {}) { | ||
super(message); | ||
this.name = "AI_NoContentGeneratedError"; | ||
} | ||
static isNoContentGeneratedError(error) { | ||
return error instanceof Error && error.name === "AI_NoContentGeneratedError"; | ||
} | ||
toJSON() { | ||
return { | ||
name: this.name, | ||
cause: this.cause, | ||
message: this.message, | ||
stack: this.stack | ||
}; | ||
} | ||
}; | ||
// src/errors/no-object-generated-error.ts | ||
var NoObjectGeneratedError = class extends Error { | ||
constructor() { | ||
super(`No object generated.`); | ||
constructor({ message = "No object generated." } = {}) { | ||
super(message); | ||
this.name = "AI_NoObjectGeneratedError"; | ||
} | ||
static isNoTextGeneratedError(error) { | ||
static isNoObjectGeneratedError(error) { | ||
return error instanceof Error && error.name === "AI_NoObjectGeneratedError"; | ||
@@ -502,2 +542,4 @@ } | ||
LoadAPIKeyError, | ||
LoadSettingError, | ||
NoContentGeneratedError, | ||
NoObjectGeneratedError, | ||
@@ -504,0 +546,0 @@ NoSuchToolError, |
{ | ||
"name": "@ai-sdk/provider", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155529
2318