Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownProvider = errors.New("provider: unknown provider") ErrRateLimit = errors.New("provider: rate limit exceeded") ErrContextTooLong = errors.New("provider: input exceeds model context window") ErrModelNotSupported = errors.New("provider: model not supported by this provider") ErrTimeout = errors.New("provider: request timed out") )
Functions ¶
Types ¶
type ContextOptions ¶ added in v1.3.0
type ContextOptions struct {
// Enabled is true when --with-context was passed. When false the CLI
// provider behaves exactly as before (diff-only, no extra read tools,
// inherited working directory).
Enabled bool
// RepoRoot is the repository root the host CLI should run in, so its
// relative file reads resolve deterministically. Set as the
// subprocess working directory only when Enabled.
RepoRoot string
}
ContextOptions carries the --with-context signal (ADR-0017) to the CLI-backed providers via Request.ProviderOpts. It lives in the neutral provider package so the CLI layer can set it without importing a concrete provider subpackage, and the clireview backend reads it via a type assertion. API providers ignore ProviderOpts entirely, so a ContextOptions value is inert for them.
type PlainTextEmitter ¶ added in v0.9.0
type PlainTextEmitter interface {
Provider
EmitsPlainText()
}
PlainTextEmitter is the marker interface for providers whose Review() returns formatted plain text instead of the structured findings JSON the API providers contract. The review pipeline uses this to short-circuit JSON parsing, retry-once, and the cards/markdown renderer — the response is emitted to stdout verbatim because the CLI tool has already formatted it.
CLI-based providers (claude-cli, gemini-cli, codex-cli) implement this so they can pass through their host CLI's output without the JSON-contract enforcement that API providers do via native structured-output mechanisms (tool_use / response_format / response_schema).
type Pricing ¶
type Provider ¶
type Request ¶
type Request struct {
Model string
SystemPrompt string
UserPrompt string
Lang string
MaxTokens int
// FreeForm requests an unstructured plain-text completion (ADR-0015).
// When true, API providers MUST skip their structured-output
// enforcement (Anthropic tool_choice, OpenAI response_format, Gemini
// responseSchema, Ollama format:json) and return the model's raw text
// in Response.Content. Default false preserves the ADR-0014
// structured-findings contract, so existing call sites are unaffected.
// Used by `--suggest-commit` to get a commit message instead of findings.
FreeForm bool
// ProviderOpts is an escape hatch (ADR-0001 risk #1) for features that
// don't fit the common interface, e.g. Anthropic prompt caching or
// OpenAI logprobs. Providers cast to their expected type; unknown values
// are ignored.
ProviderOpts any
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package claudecli registers a CLI-tool-backed provider that drives Anthropic's Claude Code (`claude`) binary as the review engine.
|
Package claudecli registers a CLI-tool-backed provider that drives Anthropic's Claude Code (`claude`) binary as the review engine. |
|
Package clireview is the shared implementation of CLI-tool-backed review providers.
|
Package clireview is the shared implementation of CLI-tool-backed review providers. |
|
Package codexcli registers a CLI-tool-backed provider that drives OpenAI's Codex CLI (`codex`) binary as the review engine.
|
Package codexcli registers a CLI-tool-backed provider that drives OpenAI's Codex CLI (`codex`) binary as the review engine. |
|
Package cohere implements the Provider interface against Cohere's OpenAI-compatibility endpoint (https://api.cohere.ai/compatibility/v1), reusing the openai-go SDK — no new dependency.
|
Package cohere implements the Provider interface against Cohere's OpenAI-compatibility endpoint (https://api.cohere.ai/compatibility/v1), reusing the openai-go SDK — no new dependency. |
|
Package deepseek implements the Provider interface against DeepSeek's OpenAI-compatible Chat Completions API.
|
Package deepseek implements the Provider interface against DeepSeek's OpenAI-compatible Chat Completions API. |
|
Package geminicli registers a CLI-tool-backed provider that drives Google's Gemini CLI (`gemini`) binary as the review engine.
|
Package geminicli registers a CLI-tool-backed provider that drives Google's Gemini CLI (`gemini`) binary as the review engine. |
|
Package mistral implements the Provider interface against Mistral's OpenAI-compatible Chat Completions API (https://api.mistral.ai/v1), reusing the openai-go SDK — no new dependency.
|
Package mistral implements the Provider interface against Mistral's OpenAI-compatible Chat Completions API (https://api.mistral.ai/v1), reusing the openai-go SDK — no new dependency. |