Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 9 Imported by: 0

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

func DefaultPath() (string, error)

DefaultPath returns the per-user config file, tinyagent/config.yaml under os.UserConfigDir, whether or not it exists.

func Find

func Find(explicit string) string

Find returns the config file to Load: explicit if set, else the per-user config if it exists, else "" for the defaults. A user config that exists but can't be read is still returned, so Load reports it by name.

Types

type AgentConfig

type AgentConfig struct {
	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"`

	// 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"`
}

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.

Jump to

Keyboard shortcuts

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