Documentation
¶
Overview ¶
Package common provides shared utilities and infrastructure for AI provider implementations. This includes standardized error handling, authentication helpers, configuration management, health checking, metrics collection, and other common functionality across providers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶ added in v1.0.4
type APIError struct {
StatusCode int
Type APIErrorType
Message string
RawBody string
Retryable bool
}
APIError represents a standardized provider error
func (*APIError) IsRateLimit ¶ added in v1.0.4
IsRateLimit checks if the error is a rate limit error
func (*APIError) IsRetryable ¶ added in v1.0.4
IsRetryable checks if the error is retryable
type APIErrorType ¶ added in v1.0.4
type APIErrorType string
APIErrorType classifies API errors
const ( APIErrorTypeRateLimit APIErrorType = "rate_limit" APIErrorTypeAuth APIErrorType = "auth" APIErrorTypeNotFound APIErrorType = "not_found" APIErrorTypeInvalidRequest APIErrorType = "invalid_request" APIErrorTypeServer APIErrorType = "server_error" APIErrorTypeUnknown APIErrorType = "unknown" )
type ErrorClassifier ¶ added in v1.0.4
ErrorClassifier interface for provider-specific error parsing Providers can implement this to provide more detailed error classification based on their specific API error response formats