Versions in this module Expand all Collapse all v0 v0.2.0 Jul 14, 2026 v0.1.0 Jun 22, 2026 Changes in this version + const RetryClassificationAuthError + const RetryClassificationClientError + const RetryClassificationModelDeprecated + const RetryClassificationNetwork + const RetryClassificationQuotaExhausted + const RetryClassificationRateLimit + const RetryClassificationRegionallyUnavailable + const RetryClassificationServerError + const RetryClassificationServerOverload + const RetryClassificationTimeout + const RetryClassificationUnknown + func AllProvidersInfo() map[types.APIProvider]ProviderInfo + func DefaultBaseURL(providerName string) string + func DefaultConfigs() map[types.APIProvider]*Config + func DefaultModelIdentifier(provider types.APIProvider) (types.ModelIdentifier, bool) + func GetGlobalAPIKey() string + func GetOAuthToken(ctx context.Context, provider string) (string, error) + func InitOAuth(clientID string) + func Is529Error(resp *http.Response, err error) bool + func IsCircuitBreakerOpenError(err error) bool + func IsCircuitBreakerTimeoutError(err error) bool + func IsModelDeprecatedError(err error, resp *http.Response) bool + func IsQuotaExhaustedError(err error, resp *http.Response) bool + func IsRateLimitError(resp *http.Response) bool + func IsRegionallyUnavailableError(err error, resp *http.Response) bool + func IsRetryableStatus(statusCode int) bool + func LoginProvider(ctx context.Context, provider string) (string, string, error) + func NeedsCatalogReseed(providerName string, knownModelIDs []string) bool + func OllamaModelLookup() map[string]ModelInfo + func ParseContextOverflowError(err error) (inputTokens, maxTokens, contextLimit int, ok bool) + func RecoveryHint(classification RetryClassification, modelID string) string + func ResolveProviderFromString(s string) types.APIProvider + func RetryWithStrategy(ctx context.Context, strategy *RetryStrategy, model types.ModelIdentifier, ...) (*types.APIResponse, error) + func SetAPIKey(ctx context.Context, provider, apiKey string) error + func SetGlobalAPIKey(key string) + func ValidateProviderConfig(config *Config) error + func WaitForLogin(ctx context.Context, provider string) error + type AuthClient struct + func NewAuthClient(ctx context.Context, provider types.APIProvider) (*AuthClient, error) + func NewAuthClientWithConfig(ctx context.Context, config *Config) (*AuthClient, error) + type BedrockTransport = providertransport.BedrockTransport + func NewBedrockTransport(apiKey string, config *Config) (*BedrockTransport, error) + type CircuitBreaker struct + func NewCircuitBreaker() *CircuitBreaker + func NewCircuitBreakerWithConfig(config *CircuitBreakerConfig) *CircuitBreaker + func (cb *CircuitBreaker) CanExecute() bool + func (cb *CircuitBreaker) Execute(fn func() error) error + func (cb *CircuitBreaker) ExecuteWithTimeout(ctx context.Context, fn func(context.Context) error) error + func (cb *CircuitBreaker) IsAvailable() bool + func (cb *CircuitBreaker) RecordFailure() + func (cb *CircuitBreaker) RecordSuccess() + func (cb *CircuitBreaker) Reset() + func (cb *CircuitBreaker) State() CircuitState + func (cb *CircuitBreaker) Stats() CircuitBreakerStats + type CircuitBreakerConfig struct + CallTimeout time.Duration + HalfOpenMaxCalls int + MaxFailures int + OnStateChange func(from, to CircuitState) + ReadyToTrip func() bool + ResetTimeout time.Duration + func DefaultCircuitBreakerConfig() *CircuitBreakerConfig + type CircuitBreakerOpenError struct + State CircuitState + func (e *CircuitBreakerOpenError) Error() string + type CircuitBreakerStats struct + ConsecutiveFailures int + HalfOpenCalls int + LastFailureTime time.Time + LastSuccessTime time.Time + StateTransitions uint64 + TotalFailures uint64 + TotalRequests uint64 + TotalSuccesses uint64 + type CircuitBreakerTimeoutError struct + Duration time.Duration + Timeout time.Duration + func (e *CircuitBreakerTimeoutError) Error() string + type CircuitState string + const CircuitStateClosed + const CircuitStateHalfOpen + const CircuitStateOpen + type Client struct + func NewClient(apiKey string, providerType types.APIProvider) *Client + func NewClientWithConfig(apiKey string, config *Config) *Client + func NewFallbackClient(ctx context.Context, provider types.APIProvider) (*Client, error) + func (c *Client) CircuitBreakerStats() CircuitBreakerStats + func (c *Client) Config() *Config + func (c *Client) CreateMessage(ctx context.Context, req types.APIRequest) (*types.APIResponse, error) + func (c *Client) CreateMessageStream(ctx context.Context, req types.APIRequest) (<-chan types.APIResponseChunk, error) + func (c *Client) CreateMessageStreamResult(ctx context.Context, req types.APIRequest) (*types.APIStreamResult, error) + func (c *Client) CreateMessageStreamResultWithCallback(ctx context.Context, req types.APIRequest, ...) (*types.APIStreamResult, error) + func (c *Client) EnableCircuitBreaker() + func (c *Client) EnableCircuitBreakerWithConfig(config *CircuitBreakerConfig) + func (c *Client) GetCircuitBreaker() *CircuitBreaker + func (c *Client) ResetCircuitBreaker() + func (c *Client) SetCircuitBreaker(cb *CircuitBreaker) + func (c *Client) SetHTTPClient(client *http.Client) + func (c *Client) SetMonitoring(monitoringSys *monitoring.System) + func (c *Client) SetRetryConfig(config types.RetryConfig) + type Config struct + APIKey string + BaseURL string + CustomHeaders map[string]string + ModelAliasMapping map[string]string + ProjectID string + Provider types.APIProvider + Region string + Routing *RoutingConfig + func GetProviderConfig(provider types.APIProvider) *Config + func (c *Config) BuildAuthHeaders() map[string]string + func (c *Config) GetBaseURL() string + func (c *Config) GetEndpoint(model string) string + func (c *Config) IsSupportedModel(model string) bool + func (c *Config) ResolveModel(model string) string + type DiscoveryResult struct + AuthMethod string + Available bool + DisplayName string + EnvVar string + Hint string + Priority int + Provider types.APIProvider + Recommended bool + func AvailableProviders(ctx context.Context) []DiscoveryResult + func DiscoverProviders(ctx context.Context) []DiscoveryResult + type FetchedModel struct + ContextWindow int + DisplayName string + IsDefault bool + MaxOutput int + ModelID string + SortOrder int + func FetchModels(ctx context.Context, providerName, baseURL, apiKey string) ([]FetchedModel, error) + func NormalizeModels(providerName string, models []FetchedModel) []FetchedModel + func StaticModels(providerName string) []FetchedModel + type FoundryTransport = providertransport.FoundryTransport + func NewFoundryTransport(apiKey string, config *Config) (*FoundryTransport, error) + type LoginCommand struct + Method string + Provider string + func (c *LoginCommand) Execute(ctx context.Context) error + type ModelInfo struct + Capabilities model.Capabilities + ContextWindow int + DefaultTemperature float64 + Description string + Identifier string + MaxOutput int + Pricing string + SupportsPC bool + func GetModelInfo(provider types.APIProvider, model string) (ModelInfo, bool) + type ProviderInfo struct + AuthType string + AuthTypes []string + Description string + DisplayName string + Models []ModelInfo + Name string + SupportsCVMM bool + SupportsPC bool + func GetProviderInfo(provider types.APIProvider) (ProviderInfo, bool) + type RequestFunc = providerretry.RequestFunc + type RetryClassification = providerretry.RetryClassification + func ClassifyHTTPError(err error, statusCode int) RetryClassification + type RetryState = providerretry.RetryState + func NewRetryState() *RetryState + type RetryStrategy = providerretry.RetryStrategy + func DefaultRetryStrategy() *RetryStrategy + type RoutingConfig struct + CircuitBreaker *CircuitBreakerConfig + FallbackModels []types.ModelIdentifier + FallbackProviders []types.APIProvider + Priority int + type Transport = providertransport.Transport + func NewTransport(apiKey string, config *Config) (Transport, error) + type VertexTransport = providertransport.VertexTransport + func NewVertexTransport(apiKey string, config *Config) (*VertexTransport, error)