Documentation
¶
Overview ¶
Package cheapmodel provides a minimal Anthropic Messages client used as the engine's injected extraction model. It implements engine.Model. (An OpenAI variant is a straightforward follow-up; the canonical model is Anthropic-shaped, so the Anthropic client is the natural first.)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Anthropic ¶
type Anthropic struct {
BaseURL string // default https://api.anthropic.com
APIKey string
Model string // e.g. claude-haiku-4-5
MaxTokens int // default 2048
Client *http.Client
// AuthScheme selects how the API key is sent. "" or "x-api-key" sends the
// x-api-key header (Anthropic default). "bearer" sends
// Authorization: Bearer <APIKey> instead, for gateways (e.g. an IBM LiteLLM
// Anthropic-compatible endpoint) that authenticate with a bearer token. The
// anthropic-version header is sent in both cases.
AuthScheme string
}
Anthropic calls a small Anthropic model with a single user prompt and returns the text of the first content block.
type OpenAI ¶
type OpenAI struct {
BaseURL string // default https://api.openai.com
APIKey string
Model string // e.g. gpt-4o-mini
MaxTokens int // default 2048
Client *http.Client
}
OpenAI calls a small OpenAI chat-completions model with a single user prompt and returns the content of the first choice. It implements engine.Model.