Documentation
¶
Index ¶
Constants ¶
const DefaultMaxTokens = 1024
DefaultMaxTokens is used when MaxTokens is 0 and the provider requires it (e.g. Anthropic).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LLMConfig ¶
type LLMConfig struct {
APIKey string
Model string
BaseURL string
Logger logger.Logger
LogLevel string
// PromptCaching is Anthropic-only; nil means disabled. Set via WithPromptCaching.
PromptCaching *bool
}
func BuildConfig ¶
BuildConfig builds LLMConfig from options, requiring a non-empty APIKey. For keyless/local providers use BuildConfigKeyless. Defaults when not set:
- LogLevel: "error"
- Logger: stderr slog logger at LogLevel
Sampling (Temperature, MaxTokens, TopP, TopK) is per-agent—use agent.WithTemperature etc.
func BuildConfigKeyless ¶ added in v0.2.6
BuildConfigKeyless builds LLMConfig from options without requiring an APIKey. It is for keyless/local providers (e.g. Ollama) whose transport ignores auth. Defaults when not set:
- LogLevel: "error"
- Logger: stderr slog logger at LogLevel
Sampling (Temperature, MaxTokens, TopP, TopK) is per-agent—use agent.WithTemperature etc.
type Option ¶
type Option func(*LLMConfig)
func WithAPIKey ¶
func WithBaseURL ¶
func WithLogLevel ¶
func WithLogger ¶
func WithPromptCaching ¶ added in v0.2.6
WithPromptCaching enables or disables Anthropic prompt-cache breakpoints. Default when unset is disabled (write cost / short TTL are a poor fit at low volume). OpenAI/Gemini/DeepSeek ignore this option.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package deepseek provides an interfaces.LLMClient for DeepSeek.
|
Package deepseek provides an interfaces.LLMClient for DeepSeek. |
|
Package ollama provides an interfaces.LLMClient for Ollama, covering both a local daemon and Ollama Cloud (ollama.com).
|
Package ollama provides an interfaces.LLMClient for Ollama, covering both a local daemon and Ollama Cloud (ollama.com). |