Documentation
¶
Index ¶
- func ConfigDir() string
- func DataDir() string
- func Fatal(format string, args ...any)
- func InitErrorLog()
- func LogError(err error, operation string)
- func Warn(format string, args ...any)
- type AgentConfig
- type ChromaConfig
- type Config
- type Context
- func (c *Context) DefaultReasoningEffort() api.ReasoningEffort
- func (c *Context) DefaultSystemPrompt() string
- func (c *Context) GetAgent(name string) *api.Agent
- func (c *Context) GetAgents() (agents []string)
- func (c *Context) GetAllModels() (models []string)
- func (c *Context) GetCodeAgentName() string
- func (c *Context) GetDefaultModel() (*api.Model, error)
- func (c *Context) LookupModel(model string, providerName string) (*api.Model, error)
- type ConversationsConfig
- type DefaultsConfig
- type ModelConfig
- type ProviderConfig
- type TUIConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitErrorLog ¶
func InitErrorLog()
InitErrorLog opens (or creates) the error log file. Safe to call multiple times — subsequent calls are no-ops.
Types ¶
type AgentConfig ¶
type ChromaConfig ¶
type Config ¶
type Config struct {
Defaults *DefaultsConfig `yaml:"defaults"`
Conversations *ConversationsConfig `yaml:"conversations"`
Chroma *ChromaConfig `yaml:"chroma"`
Agents []*AgentConfig `yaml:"agents"`
Providers []*ProviderConfig `yaml:"providers"`
Sandbox *sandbox.SandboxConfig `yaml:"sandbox"`
TUI *TUIConfig `yaml:"tui"`
}
func (*Config) HideHelpHint ¶
type Context ¶
type Context struct {
// global app configuration - read-only after startup
Config Config
Providers []api.Provider
Agents []api.Agent
Conversations conversation.Repo
Chroma render.ChromaHighlighter
}
func NewContext ¶
func (*Context) DefaultReasoningEffort ¶
func (c *Context) DefaultReasoningEffort() api.ReasoningEffort
func (*Context) DefaultSystemPrompt ¶
func (*Context) GetAllModels ¶
GetAllModels returns a string slice of *all* models: - All models are returned with the @provider suffix - Models with a unique name before the @provider are added without the suffix
func (*Context) GetCodeAgentName ¶
GetCodeAgentName returns the default code agent name from config, or the first agent marked as Code. Returns empty string if no code agent is configured.
type ConversationsConfig ¶
type DefaultsConfig ¶
type DefaultsConfig struct {
Model *string `yaml:"model" default:""`
MaxTokens *int `yaml:"maxTokens" default:"32768"`
Temperature *float32 `yaml:"temperature" default:"0.8"`
Effort *string `yaml:"effort" default:"medium"`
SystemPrompt string `yaml:"systemPrompt,omitempty"`
SystemPromptFile string `yaml:"systemPromptFile,omitempty"`
Agent string `yaml:"agent,omitempty"`
CodeAgent string `yaml:"codeAgent,omitempty"`
}
type ModelConfig ¶
type ModelConfig struct {
Name string `yaml:"name"`
MaxTokens *int `yaml:"maxTokens,omitempty"`
Temperature *float32 `yaml:"temperature,omitempty"`
}
ModelConfig represents a single model in a provider's configuration. It supports both shorthand (string) and expanded (map) YAML forms:
func (*ModelConfig) UnmarshalYAML ¶
func (m *ModelConfig) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements custom YAML unmarshaling for ModelEntry, supporting both string shorthand and full map forms.
type ProviderConfig ¶
type ProviderConfig struct {
Name string `yaml:"name,omitempty"`
Display string `yaml:"display,omitempty"`
Kind string `yaml:"kind"`
Style string `yaml:"style,omitempty"`
BaseURL string `yaml:"baseUrl,omitempty"`
APIKey string `yaml:"apiKey,omitempty"`
Headers map[string]string `yaml:"headers,omitempty"`
Models []ModelConfig `yaml:"models"`
}