config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns the golem config directory

func ConfigPath

func ConfigPath() string

ConfigPath returns the config file path

func Save

func Save(cfg *Config) error

Save saves config to file

Types

type AgentDefaults

type AgentDefaults struct {
	Workspace         string  `mapstructure:"workspace"`
	WorkspaceMode     string  `mapstructure:"workspace_mode"`
	Model             string  `mapstructure:"model"`
	MaxTokens         int     `mapstructure:"max_tokens"`
	Temperature       float64 `mapstructure:"temperature"`
	MaxToolIterations int     `mapstructure:"max_tool_iterations"`
}

AgentDefaults default agent parameters

type AgentsConfig

type AgentsConfig struct {
	Defaults AgentDefaults `mapstructure:"defaults"`
}

AgentsConfig agent settings

type ChannelsConfig

type ChannelsConfig struct {
	Telegram TelegramConfig `mapstructure:"telegram"`
}

ChannelsConfig channel settings

type Config

type Config struct {
	Agents    AgentsConfig    `mapstructure:"agents"`
	Channels  ChannelsConfig  `mapstructure:"channels"`
	Providers ProvidersConfig `mapstructure:"providers"`
	Gateway   GatewayConfig   `mapstructure:"gateway"`
	Tools     ToolsConfig     `mapstructure:"tools"`
}

Config root configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns config with sensible defaults

func Load

func Load() (*Config, error)

Load loads config from file or returns defaults

func (*Config) WorkspacePath

func (c *Config) WorkspacePath() string

WorkspacePath returns the expanded workspace path

func (*Config) WorkspacePathChecked

func (c *Config) WorkspacePathChecked() (string, error)

WorkspacePathChecked returns the expanded workspace path or an error if invalid.

type ExecToolConfig

type ExecToolConfig struct {
	Timeout             int  `mapstructure:"timeout"`
	RestrictToWorkspace bool `mapstructure:"restrict_to_workspace"`
}

ExecToolConfig shell exec settings

type GatewayConfig

type GatewayConfig struct {
	Host string `mapstructure:"host"`
	Port int    `mapstructure:"port"`
}

GatewayConfig server settings

type ProviderConfig

type ProviderConfig struct {
	APIKey    string `mapstructure:"api_key"`
	SecretKey string `mapstructure:"secret_key"`
	BaseURL   string `mapstructure:"base_url"`
}

ProviderConfig single provider settings

type ProvidersConfig

type ProvidersConfig struct {
	OpenRouter ProviderConfig `mapstructure:"openrouter"`
	Claude     ProviderConfig `mapstructure:"claude"`
	OpenAI     ProviderConfig `mapstructure:"openai"`
	DeepSeek   ProviderConfig `mapstructure:"deepseek"`
	Gemini     ProviderConfig `mapstructure:"gemini"`
	Ark        ProviderConfig `mapstructure:"ark"`
	Qianfan    ProviderConfig `mapstructure:"qianfan"`
	Qwen       ProviderConfig `mapstructure:"qwen"`
	Ollama     ProviderConfig `mapstructure:"ollama"`
}

ProvidersConfig LLM provider settings

type TelegramConfig

type TelegramConfig struct {
	Enabled   bool     `mapstructure:"enabled"`
	Token     string   `mapstructure:"token"`
	AllowFrom []string `mapstructure:"allow_from"`
}

TelegramConfig telegram bot settings

type ToolsConfig

type ToolsConfig struct {
	Web  WebToolsConfig `mapstructure:"web"`
	Exec ExecToolConfig `mapstructure:"exec"`
}

ToolsConfig tool settings

type WebSearchConfig

type WebSearchConfig struct {
	APIKey     string `mapstructure:"api_key"`
	MaxResults int    `mapstructure:"max_results"`
}

WebSearchConfig brave search settings

type WebToolsConfig

type WebToolsConfig struct {
	Search WebSearchConfig `mapstructure:"search"`
}

WebToolsConfig web tool settings

Jump to

Keyboard shortcuts

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