Documentation
¶
Overview ¶
Package config provides configuration types and functional options for agent applications.
Index ¶
- type AppConfig
- type ClientConfig
- type Config
- type Option
- func WithAnthropicKey(key string) Option
- func WithApp(name, version, description string) Option
- func WithModel(model string) Option
- func WithProvider(provider string) Option
- func WithSDKOption(opt claude.ClientOption) Option
- func WithSystemPrompt(prompt string) Option
- func WithTimeout(timeout time.Duration) Option
- type ProviderConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct {
// SystemPrompt is the system prompt to use for all queries.
SystemPrompt string
// Model is the default model to use.
Model string
// Timeout is the default timeout for queries.
Timeout time.Duration
// SDKOptions are passed directly to the Claude SDK client.
SDKOptions []claude.ClientOption
}
ClientConfig wraps SDK client options with additional agent-specific configuration.
type Config ¶
type Config struct {
App AppConfig
Provider ProviderConfig
Client ClientConfig
}
Config is the complete configuration for an agent application.
type Option ¶
type Option func(*Config)
Option is a functional option for configuring Config.
func WithAnthropicKey ¶
WithAnthropicKey sets the Anthropic API key.
func WithSDKOption ¶
func WithSDKOption(opt claude.ClientOption) Option
WithSDKOption adds a Claude SDK client option.
func WithSystemPrompt ¶
WithSystemPrompt sets the system prompt.
func WithTimeout ¶
WithTimeout sets the default timeout.
type ProviderConfig ¶
type ProviderConfig struct {
// Provider is the AI provider to use (anthropic, zai, synthetic).
Provider string `json:"provider"`
// Anthropic settings
AnthropicAPIKey string `json:"-"` // Excluded from JSON serialization for security
AnthropicModel string `json:"anthropic_model,omitempty"`
// ZAI settings
ZAIAPIKey string `json:"-"` // Excluded from JSON serialization for security
ZAIModel string `json:"zai_model,omitempty"`
ZAIBaseURL string `json:"zai_base_url,omitempty"`
// Synthetic settings (for testing)
SyntheticResponse string `json:"synthetic_response,omitempty"`
}
ProviderConfig contains provider-specific settings.
Click to show internal directories.
Click to hide internal directories.