Documentation
¶
Overview ¶
Package providers implements the Reviewer interface for each supported LLM provider.
Supported providers: Anthropic (Claude), OpenAI (GPT), Google (Gemini), and Ollama / LMStudio for local models.
All providers share a common retry helper with exponential back-off and rate-limit handling. HTTP clients are injected via a transport field so that tests can redirect calls to local httptest servers without making live API requests.
Use New to obtain a Reviewer by provider name and model string.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultMaxConcurrency ¶ added in v0.6.0
DefaultMaxConcurrency returns the default number of concurrent LLM calls for a named provider. Local providers can handle more concurrency since they are not subject to network rate limits.
func DefaultRPM ¶ added in v0.6.0
DefaultRPM returns the conservative default requests-per-minute rate limit for a named provider. Returns 0 (unlimited) for local providers.
func IsAuthError ¶
IsAuthError checks if an error is an authentication error.
Types ¶
type Anthropic ¶
type Anthropic struct {
// contains filtered or unexported fields
}
Anthropic implements the Reviewer interface for Anthropic's API.
func NewAnthropic ¶
NewAnthropic creates a new Anthropic provider.
func (*Anthropic) Review ¶
func (a *Anthropic) Review(ctx context.Context, req ReviewRequest) (ReviewResponse, error)
type Gemini ¶
type Gemini struct {
// contains filtered or unexported fields
}
Gemini implements the Reviewer interface for Google's Gemini API.
func (*Gemini) Review ¶
func (g *Gemini) Review(ctx context.Context, req ReviewRequest) (ReviewResponse, error)
type Ollama ¶
type Ollama struct {
// contains filtered or unexported fields
}
Ollama implements the Reviewer interface for Ollama and LM Studio (OpenAI-compatible API).
func (*Ollama) Review ¶
func (o *Ollama) Review(ctx context.Context, req ReviewRequest) (ReviewResponse, error)
type OpenAI ¶
type OpenAI struct {
// contains filtered or unexported fields
}
OpenAI implements the Reviewer interface for OpenAI's API.
func (*OpenAI) Review ¶
func (o *OpenAI) Review(ctx context.Context, req ReviewRequest) (ReviewResponse, error)
type ReviewRequest ¶
type ReviewRequest struct {
SystemPrompt string
UserPrompt string
MaxTokens int
Temperature float64
}
ReviewRequest contains the data sent to an LLM for review.
type ReviewResponse ¶
type ReviewResponse struct {
Content string
TokensUsed int
// Provider identifies the LLM vendor that produced this response
// (e.g. "anthropic", "openai", "gemini", "ollama").
Provider string
// Model identifies the concrete model used (e.g. "claude-opus-4-5").
Model string
}
ReviewResponse contains the raw response from an LLM.