Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProviderAnthropic = "anthropic" ProviderOpenAI = "openai" ProviderCopilot = "copilot" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSBedrock ¶
type AWSBedrock struct {
Region string
AccessKey, AccessKeySecret string
Model, SmallFastModel string
// If set, requests will be sent to this URL instead of the default AWS Bedrock endpoint
// (https://bedrock-runtime.{region}.amazonaws.com).
// This is useful for routing requests through a proxy or for testing.
BaseURL string
}
type Anthropic ¶
type Anthropic struct {
BaseURL string
Key string
APIDumpDir string
CircuitBreaker *CircuitBreaker
SendActorHeaders bool
}
type CircuitBreaker ¶
type CircuitBreaker struct {
// MaxRequests is the maximum number of requests allowed in half-open state.
MaxRequests uint32
// Interval is the cyclic period of the closed state for clearing internal counts.
Interval time.Duration
// Timeout is how long the circuit stays open before transitioning to half-open.
Timeout time.Duration
// FailureThreshold is the number of consecutive failures that triggers the circuit to open.
FailureThreshold uint32
// IsFailure determines if a status code should count as a failure.
// If nil, defaults to DefaultIsFailure.
IsFailure func(statusCode int) bool
// OpenErrorResponse returns the response body when the circuit is open.
// This should match the provider's error format.
OpenErrorResponse func() []byte
}
CircuitBreaker holds configuration for circuit breakers.
func DefaultCircuitBreaker ¶
func DefaultCircuitBreaker() CircuitBreaker
DefaultCircuitBreaker returns sensible defaults for circuit breaker configuration.
type Copilot ¶
type Copilot struct {
BaseURL string
APIDumpDir string
CircuitBreaker *CircuitBreaker
}
Click to show internal directories.
Click to hide internal directories.