Documentation
¶
Overview ¶
Package api implements the LLM gateway against an HTTP endpoint that speaks either Anthropic's Messages API or OpenAI's Chat Completions API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoAPIKey = errors.New("api: an API key is required")
ErrNoAPIKey is returned when no key is configured.
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway is a direct-API LLM gateway.
type Options ¶
type Options struct {
BaseURL string
APIKey string
StrongModel string
FastModel string
AuthStyle AuthStyle
// Format defaults to FormatAnthropic.
Format Format
// AuthHeader, when set, carries the key in that header instead of the
// Authorization or x-api-key header. Azure and some proxies want one.
AuthHeader string
Cache llm.Cache
HTTPClient *http.Client
MaxRetries int
Sleep func(time.Duration)
}
Options configures the gateway.
Click to show internal directories.
Click to hide internal directories.