Skip to main content

Module error

Module error 

Source
Expand description

Errors that provider adapters can return.

ProviderError is the single error type of every adapter method. Each variant wraps a concrete error struct so that callers can match on the failure class and read structured fields. Large payloads are boxed to keep the enum small enough to pass through Result cheaply.

Structs§

ApiCallError
An HTTP request to the provider failed or returned an error status.
EmptyResponseBodyError
The provider returned an empty body where one was required.
InvalidArgumentError
A call argument is invalid.
InvalidPromptError
The prompt cannot be used with this provider.
InvalidResponseDataError
The response has an unexpected shape.
JsonParseError
Text could not be parsed as JSON.
LoadApiKeyError
The API key could not be loaded.
LoadSettingError
A required setting could not be loaded.
NoContentGeneratedError
The provider produced no content.
NoSuchModelError
The requested model does not exist or the provider has no models of that kind.
NoSuchProviderReferenceError
A provider reference has no entry for the provider that received it.
TooManyEmbeddingValuesForCallError
Too many values were passed to a single embedding call.
TypeValidationContext
Where a validated value came from, for error messages.
TypeValidationError
A value failed schema or type validation.
UnsupportedFunctionalityError
The provider or model does not support the requested functionality.

Enums§

ModelKind
Kinds of models a provider can expose.
ProviderError
Error returned by provider adapters.

Functions§

default_retryable
Returns the default retry classification for an HTTP status.

Type Aliases§

BoxError
Boxed dynamic error used for causes and for ProviderError::Other.