config

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config provides configuration types and functional options for agent applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name        string
	Version     string
	Description string
}

AppConfig contains application metadata.

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.

func NewConfig

func NewConfig(opts ...Option) *Config

NewConfig creates a new Config with functional options.

type Option

type Option func(*Config)

Option is a functional option for configuring Config.

func WithAnthropicKey

func WithAnthropicKey(key string) Option

WithAnthropicKey sets the Anthropic API key.

func WithApp

func WithApp(name, version, description string) Option

WithApp sets application metadata.

func WithModel

func WithModel(model string) Option

WithModel sets the default model.

func WithProvider

func WithProvider(provider string) Option

WithProvider sets the AI provider.

func WithSDKOption

func WithSDKOption(opt claude.ClientOption) Option

WithSDKOption adds a Claude SDK client option.

func WithSystemPrompt

func WithSystemPrompt(prompt string) Option

WithSystemPrompt sets the system prompt.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL