Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Duration ¶
func (Duration) MarshalJSON ¶
func (Duration) MarshalText ¶
func (*Duration) UnmarshalJSON ¶
func (*Duration) UnmarshalText ¶
type ErrorClass ¶
type ErrorClass string
const ( ClassNone ErrorClass = "" ClassRateLimit ErrorClass = "rate_limit" ClassServerError ErrorClass = "server_error" ClassTimeout ErrorClass = "timeout" ClassAuth ErrorClass = "auth" ClassCapacity ErrorClass = "capacity" ClassCanceled ErrorClass = "canceled" ClassPermanent ErrorClass = "permanent" )
func ClassifyError ¶
func ClassifyError(err error) ErrorClass
func (ErrorClass) IsRetryable ¶
func (c ErrorClass) IsRetryable() bool
type Outcome ¶
type Outcome struct {
Attempts int
UsedFallback bool
LastErrorClass ErrorClass
Elapsed time.Duration
}
type RetryPolicy ¶
type RetryPolicy struct {
MaxAttempts int `yaml:"max_attempts,omitempty" json:"max_attempts,omitempty" toml:"max_attempts,omitempty"`
InitialBackoff Duration `yaml:"initial_backoff,omitempty" json:"initial_backoff,omitempty" toml:"initial_backoff,omitempty"`
MaxBackoff Duration `yaml:"max_backoff,omitempty" json:"max_backoff,omitempty" toml:"max_backoff,omitempty"`
Jitter float64 `yaml:"jitter,omitempty" json:"jitter,omitempty" toml:"jitter,omitempty"`
RateLimitMinWait Duration `yaml:"rate_limit_min_wait,omitempty" json:"rate_limit_min_wait,omitempty" toml:"rate_limit_min_wait,omitempty"`
FallbackModelID string `yaml:"fallback_model_id,omitempty" json:"fallback_model_id,omitempty" toml:"fallback_model_id,omitempty"`
FallbackAfter int `yaml:"fallback_after,omitempty" json:"fallback_after,omitempty" toml:"fallback_after,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.