config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server        ServerConfig        `yaml:"server"`
	TLS           TLSConfig           `yaml:"tls"`
	Redis         RedisConfig         `yaml:"redis"`
	Providers     ProvidersConfig     `yaml:"providers"`
	Observability ObservabilityConfig `yaml:"observability"`
	Memory        MemoryConfig        `yaml:"memory"`
	Sandbox       SandboxConfig       `yaml:"sandbox"`
	Vector        VectorConfig        `yaml:"vector"`
}

func Load

func Load(path string) (*Config, error)

Load loads configuration from file and environment variables.

type LLMConfig

type LLMConfig struct {
	Default    string            `yaml:"default"`
	ModelScope LLMProviderConfig `yaml:"modelscope"`
	OpenAI     LLMProviderConfig `yaml:"openai"`
}

type LLMProviderConfig

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

type MemoryConfig

type MemoryConfig struct {
	DataDir            string `yaml:"data_dir"`             // default: "./data"
	SummaryThreshold   int    `yaml:"summary_threshold"`    // default: 20 messages
	SummaryEnabled     bool   `yaml:"summary_enabled"`      // default: true
	MaxHistoryMessages int    `yaml:"max_history_messages"` // default: 50
}

type ObservabilityConfig

type ObservabilityConfig struct {
	LogLevel     string `yaml:"log_level"`     // debug, info, warn, error
	OtelEnabled  bool   `yaml:"otel_enabled"`  // enable OpenTelemetry
	OtelEndpoint string `yaml:"otel_endpoint"` // OTLP gRPC endpoint
}

type ProvidersConfig

type ProvidersConfig struct {
	LLM LLMConfig `yaml:"llm"`
}

type RedisConfig

type RedisConfig struct {
	URL string `yaml:"url"`
}

type SandboxConfig

type SandboxConfig struct {
	// HTTPAllowlist controls which URLs Wasm skills may access.
	// Patterns: "https://api.example.com", "*.example.com", "*" (allow all).
	// Default: ["*"] for development; restrict for production.
	HTTPAllowlist []string `yaml:"http_allowlist"`

	// ToolRegistryURL is the base URL for the tool registry service.
	// Default: "http://localhost:8080"
	ToolRegistryURL string `yaml:"tool_registry_url"`
}

SandboxConfig controls Wasm skill sandbox behavior.

type ServerConfig

type ServerConfig struct {
	Addr string `yaml:"addr"`
}

type TLSConfig

type TLSConfig struct {
	// CertFile is the path to the TLS certificate file (PEM format).
	// Env override: OBS_TLS_CERT_FILE
	CertFile string `yaml:"cert_file"`

	// KeyFile is the path to the TLS private key file (PEM format).
	// Env override: OBS_TLS_KEY_FILE
	KeyFile string `yaml:"key_file"`
}

TLSConfig controls TLS/HTTPS configuration.

type VectorConfig

type VectorConfig struct {
	// Enabled enables vector semantic search. Requires PostgreSQL + pgvector.
	// Default: false (system uses keyword matching).
	Enabled bool `yaml:"enabled"`

	// DatabaseURL is the PostgreSQL connection string.
	// e.g. "postgres://user:pass@localhost:5432/openbotstack?sslmode=disable"
	// Env override: OBS_VECTOR_DB_URL
	DatabaseURL string `yaml:"database_url"`

	// Model is the embedding model name.
	// Default: "text-embedding-3-small"
	Model string `yaml:"model"`

	// Dimensions is the embedding vector dimension.
	// Default: 512
	Dimensions int `yaml:"dimensions"`
}

VectorConfig controls optional vector search capabilities.

Jump to

Keyboard shortcuts

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