Documentation
¶
Overview ¶
Package config loads agent settings from an optional YAML file layered over defaults.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
DefaultPath returns the per-user config file, tinyagent/config.yaml under os.UserConfigDir, whether or not it exists.
Types ¶
type AgentConfig ¶
type AgentConfig struct {
ReadOnly bool `yaml:"read_only"`
// Model is the provider/model used when neither -m nor $AGENT_MODEL sets
// one. "" falls back to the built-in default.
Model string `yaml:"model"`
SystemPrompt string `yaml:"system_prompt"`
StepLimit int `yaml:"step_limit"`
CostLimit float64 `yaml:"cost_limit"`
WallTimeSec int `yaml:"wall_time_seconds"`
BashTimeoutSec int `yaml:"bash_timeout_seconds"`
MaxOutputChars int `yaml:"max_output_chars"`
// MaxBackgroundProcesses bounds how many start_process processes may run
// at once.
MaxBackgroundProcesses int `yaml:"max_background_processes"`
// Optional price override in USD per million tokens, for models
// missing from the built-in price table.
InputPricePerMTok float64 `yaml:"input_price_per_mtok"`
OutputPricePerMTok float64 `yaml:"output_price_per_mtok"`
// ContextWindow, in tokens, overrides the built-in context window table.
// 0 uses the table.
ContextWindow int `yaml:"context_window"`
MCPServers []MCPServer `yaml:"mcp_servers,omitempty"`
}
func Default ¶
func Default() AgentConfig
func Load ¶
func Load(path string) (AgentConfig, error)
Load returns the defaults overlaid with the YAML file at path. An empty path returns the defaults. Unknown keys are an error, so a typo can't silently drop a setting.
type MCPServer ¶ added in v0.4.0
type MCPServer struct {
Alias string `yaml:"alias"`
Command string `yaml:"command"`
Args []string `yaml:"args,omitempty"`
Tools []string `yaml:"tools"`
Env []string `yaml:"env,omitempty"`
DiscoveryTimeoutSec int `yaml:"discovery_timeout_seconds"`
CallTimeoutSec int `yaml:"call_timeout_seconds"`
}
MCPServer grants access to selected tools from one local stdio server.
Click to show internal directories.
Click to hide internal directories.