config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string) error

Types

type AgentConfig

type AgentConfig struct {
	MaxIterations      int         `yaml:"max_iterations"`
	SystemMessage      string      `yaml:"system_message"`
	Temperature        float64     `yaml:"temperature"`
	MaxTokens          int         `yaml:"max_tokens"`
	TopP               float64     `yaml:"top_p"`
	FrequencyPenalty   float64     `yaml:"frequency_penalty"`
	PresencePenalty    float64     `yaml:"presence_penalty"`
	Timeout            string      `yaml:"timeout"`
	RetryAttempts      int         `yaml:"retry_attempts"`
	EnableToolRetry    bool        `yaml:"enable_tool_retry"`
	MaxHistoryMessages int         `yaml:"max_history_messages"`
	MCP                MCPMetadata `yaml:"mcp"`
}

func (*AgentConfig) TimeoutDuration

func (a *AgentConfig) TimeoutDuration() (time.Duration, error)

type BuiltinConfig

type BuiltinConfig struct {
	Enabled bool            `yaml:"enabled"`
	SSH     ToolConfig      `yaml:"ssh"`
	File    ToolConfig      `yaml:"file"`
	Email   EmailToolConfig `yaml:"email"`
	Command ToolConfig      `yaml:"command"`
	Math    ToolConfig      `yaml:"math"`
	Ping    ToolConfig      `yaml:"ping"`
	Time    ToolConfig      `yaml:"time"`
}

type Config

type Config struct {
	LLM    LLMConfig    `yaml:"llm"`
	Tools  ToolsConfig  `yaml:"tools"`
	Memory MemoryConfig `yaml:"memory"`
	Agent  AgentConfig  `yaml:"agent"`
}

func Get

func Get() *Config

type DeepSeekConfig

type DeepSeekConfig struct {
	APIKey  string `yaml:"api_key"`
	BaseURL string `yaml:"base_url"`
	Model   string `yaml:"model"`
}

type EmailConfig

type EmailConfig struct {
	Address string `yaml:"address"`
	Name    string `yaml:"name"`
	Pwd     string `yaml:"pwd"`
	Host    string `yaml:"host"`
	Port    int    `yaml:"port"`
}

type EmailToolConfig

type EmailToolConfig struct {
	Enabled bool        `yaml:"enabled"`
	Config  EmailConfig `yaml:"config"`
}

type HTTPConfig

type HTTPConfig struct {
	Enabled bool `yaml:"enabled"`
}

type LLMConfig

type LLMConfig struct {
	Provider string         `yaml:"provider"`
	OpenAI   OpenAIConfig   `yaml:"openai"`
	DeepSeek DeepSeekConfig `yaml:"deepseek"`
	Volce    VolceConfig    `yaml:"volce"`
}

type MCPConfig

type MCPConfig struct {
	Enabled   bool              `yaml:"enabled"`
	URL       string            `yaml:"url"`
	Transport string            `yaml:"transport"`
	Headers   map[string]string `yaml:"headers"`
}

type MCPMetadata

type MCPMetadata struct {
	Server MCPServerMetadata `yaml:"server"`
	Tool   MCPToolMetadata   `yaml:"tool"`
}

type MCPServerMetadata

type MCPServerMetadata struct {
	Name    string `yaml:"name"`
	Version string `yaml:"version"`
}

type MCPToolMetadata

type MCPToolMetadata struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
}

type MemoryConfig

type MemoryConfig struct {
	Provider           string        `yaml:"provider"`
	SessionID          string        `yaml:"session_id"`
	MaxHistoryMessages int           `yaml:"max_history_messages"`
	Redis              RedisConfig   `yaml:"redis"`
	MongoDB            MongoDBConfig `yaml:"mongodb"`
	MySQL              MySQLConfig   `yaml:"mysql"`
	SQLite             SQLiteConfig  `yaml:"sqlite"`
}

type MongoDBConfig

type MongoDBConfig struct {
	URI         string `yaml:"uri"`
	Username    string `yaml:"username"`
	Password    string `yaml:"password"`
	Database    string `yaml:"database"`
	Collection  string `yaml:"collection"`
	MaxPoolSize int    `yaml:"max_pool_size"`
	MinPoolSize int    `yaml:"min_pool_size"`
}

type MySQLConfig added in v1.5.0

type MySQLConfig struct {
	Host             string `yaml:"host"`
	Port             int    `yaml:"port"`
	User             string `yaml:"user"`
	Password         string `yaml:"password"`
	Database         string `yaml:"database"`
	Table            string `yaml:"table"`
	MaxOpenConn      int    `yaml:"max_open_conn,omitempty"`
	MaxIdleConn      int    `yaml:"max_idle_conn,omitempty"`
	MaxIdleTimeSec   int    `yaml:"max_idle_time_sec,omitempty"`
	DisableErrorHook bool   `yaml:"disable_error_hook,omitempty"`
}

type OpenAIConfig

type OpenAIConfig struct {
	APIKey  string `yaml:"api_key"`
	BaseURL string `yaml:"base_url"`
	Model   string `yaml:"model"`
	OrgID   string `yaml:"org_id"`
	APIType string `yaml:"api_type"`
}

type RedisConfig

type RedisConfig struct {
	Host      string `yaml:"host"`
	Port      int    `yaml:"port"`
	DB        int    `yaml:"db"`
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	KeyPrefix string `yaml:"key_prefix"`
}

type SQLiteConfig added in v1.5.0

type SQLiteConfig struct {
	Path             string `yaml:"path"`
	Table            string `yaml:"table"`
	MaxOpenConn      int    `yaml:"max_open_conn,omitempty"`
	MaxIdleConn      int    `yaml:"max_idle_conn,omitempty"`
	MaxIdleTimeSec   int    `yaml:"max_idle_time_sec,omitempty"`
	DisableErrorHook bool   `yaml:"disable_error_hook,omitempty"`
}

type ToolConfig

type ToolConfig struct {
	Enabled bool `yaml:"enabled"`
}

type ToolsConfig

type ToolsConfig struct {
	MCP     []MCPConfig   `yaml:"mcp"`
	HTTP    HTTPConfig    `yaml:"http"`
	Builtin BuiltinConfig `yaml:"builtin"`
}

type VolceConfig

type VolceConfig struct {
	APIKey  string `yaml:"api_key"`
	BaseURL string `yaml:"base_url"`
	Model   string `yaml:"model"`
}

Jump to

Keyboard shortcuts

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