config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

func ConfigPath

func ConfigPath() string

Types

type AuthMethod

type AuthMethod string
const (
	AuthMethodAPIKey AuthMethod = "api_key"
	AuthMethodOAuth  AuthMethod = "oauth"
	AuthMethodNone   AuthMethod = "none"
)

type Config

type Config struct {
	Providers []ProviderConfig `yaml:"providers"`
	Consensus ConsensusConfig  `yaml:"consensus"`
	TUI       TUIConfig        `yaml:"tui"`
	Metadata  MetadataConfig   `yaml:"metadata,omitempty"`
}

func DefaultConfig

func DefaultConfig() Config

func Load

func Load() (*Config, error)

func (*Config) PrimaryProvider

func (c *Config) PrimaryProvider() *ProviderConfig

func (*Config) Save

func (c *Config) Save() error

func (*Config) Validate

func (c *Config) Validate() error

type ConsensusConfig

type ConsensusConfig struct {
	Timeout      time.Duration `yaml:"-"`
	TimeoutRaw   string        `yaml:"timeout"`
	MinResponses int           `yaml:"min_responses"`
}

type MetadataConfig

type MetadataConfig struct {
	URL         string        `yaml:"url,omitempty"`
	CacheTTLRaw string        `yaml:"cache_ttl,omitempty"`
	CacheTTL    time.Duration `yaml:"-"`
}

type ProviderConfig

type ProviderConfig struct {
	Name       string       `yaml:"name"`
	Type       ProviderType `yaml:"type"`
	Auth       AuthMethod   `yaml:"auth"`
	Model      string       `yaml:"model"`
	Primary    bool         `yaml:"primary,omitempty"`
	BaseURL    string       `yaml:"base_url,omitempty"`
	MaxContext int          `yaml:"max_context,omitempty"`
}

type ProviderType

type ProviderType string
const (
	ProviderTypeAnthropic        ProviderType = "anthropic"
	ProviderTypeOpenAI           ProviderType = "openai"
	ProviderTypeGoogle           ProviderType = "google"
	ProviderTypeOpenAICompatible ProviderType = "openai_compatible"
)

type TUIConfig

type TUIConfig struct {
	Theme          string `yaml:"theme"`
	ShowIndividual bool   `yaml:"show_individual"`
}

Jump to

Keyboard shortcuts

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