config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config loads the Agent Runtime configuration from a YAML file (server / db / memory sections) with environment-variable overrides. The YAML layout mirrors the XiaoQinglong agent-frame config so operators can reuse familiar conventions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePath

func ResolvePath(path string) string

ResolvePath returns the exact configuration path used by Load.

Types

type Config

type Config struct {
	Server  ServerConfig  `yaml:"server"`
	DB      DBConfig      `yaml:"db"`
	Memory  MemoryConfig  `yaml:"memory"`
	Sandbox SandboxConfig `yaml:"sandbox"`
	Skills  SkillsConfig  `yaml:"skills"`
}

Config is the root configuration.

func Default

func Default() Config

Default returns a Config populated with sane defaults.

func Load

func Load(path string) (Config, error)

Load reads configuration from path (if it exists), then applies environment overrides. A missing file is not an error: defaults + env are used instead.

type DBConfig

type DBConfig struct {
	Enabled         bool   `yaml:"enabled"`
	DBType          string `yaml:"db_type"`
	Username        string `yaml:"username"`
	Password        string `yaml:"password"`
	DBHost          string `yaml:"db_host"`
	DBPort          int    `yaml:"db_port"`
	DBName          string `yaml:"db_name"`
	SSLMode         string `yaml:"ssl_mode"`
	MaxOpenConn     int    `yaml:"max_open_conn"`
	MaxIdleConn     int    `yaml:"max_idle_conn"`
	ConnMaxLifetime int    `yaml:"conn_max_lifetime"` // seconds
	LogMode         int    `yaml:"log_mode"`
}

DBConfig configures the PostgreSQL connection (gorm).

func (DBConfig) DSN

func (d DBConfig) DSN() string

DSN builds a PostgreSQL DSN from the DB config.

type MemoryConfig

type MemoryConfig struct {
	Enabled          bool `yaml:"enabled"`
	AutoMigrate      bool `yaml:"auto_migrate"`
	BackgroundReview bool `yaml:"background_review"`
	MaxReviewMemory  int  `yaml:"max_review_memory"`
	InjectIntoPrompt bool `yaml:"inject_into_prompt"`
}

MemoryConfig configures the memory module behaviour.

type ModelConfig

type ModelConfig struct {
	Provider string `yaml:"provider"`
	Name     string `yaml:"name"`
	APIKey   string `yaml:"api_key"`
	APIBase  string `yaml:"api_base"`
}

ModelConfig is the default model used when a request omits models.

type SandboxConfig

type SandboxConfig struct {
	DefaultImage string `yaml:"default_image"`
	PptxImage    string `yaml:"pptx_image"`
	Workdir      string `yaml:"workdir"`
	TimeoutMs    int    `yaml:"timeout_ms"`
}

SandboxConfig holds operator-tunable defaults for skill sandbox execution. Per-request Sandbox settings still take precedence when provided.

type ServerConfig

type ServerConfig struct {
	GRPCAddr string      `yaml:"grpc_addr"`
	HTTPAddr string      `yaml:"http_addr"`
	Model    ModelConfig `yaml:"default_model"`
}

ServerConfig holds listen addresses and default model settings.

type SkillsConfig

type SkillsConfig struct {
	Dir        string `yaml:"dir"`         // overrides skill discovery directory
	ConfigPath string `yaml:"config_path"` // skills-config.yaml path
	GlobalDir  string `yaml:"global_dir"`  // additional skills directory to scan
}

SkillsConfig configures where skills and skill config are located.

Jump to

Keyboard shortcuts

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