Documentation
¶
Overview ¶
Package config loads, validates, and provides defaults for yaad's configuration (server, storage, embeddings, and related settings).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatErrors ¶
func FormatErrors(errs []ConfigError) string
FormatErrors produces a human-readable summary of validation errors.
Types ¶
type Config ¶
type Config struct {
Server ServerConfig `toml:"server"`
Memory MemoryConfig `toml:"memory"`
Search SearchConfig `toml:"search"`
Embeddings EmbeddingsConfig `toml:"embeddings"`
Decay DecayConfig `toml:"decay"`
Git GitConfig `toml:"git"`
LLM LLMConfig `toml:"llm"`
}
Config holds all Yaad configuration.
func (*Config) NewEmbeddingProvider ¶
func (c *Config) NewEmbeddingProvider() embeddings.Provider
NewEmbeddingProvider creates the embedding provider specified in config. Falls back to local stub if the provider is unknown or disabled.
type ConfigError ¶
type ConfigError struct {
Field string // Dot-separated path to the offending field (e.g. "decay.half_life_days").
Message string // Human-readable explanation of the problem.
Value interface{} // The offending value, or nil for missing-required errors.
ErrType ValidationErrorType // Categorization of the error.
}
ConfigError is a single validation problem found in the configuration.
func ValidateConfig ¶
func ValidateConfig(cfg *Config) []ConfigError
ValidateConfig runs all built-in validators against cfg and returns the aggregated list of ConfigErrors.
func (ConfigError) String ¶
func (e ConfigError) String() string
type ConfigValidator ¶
type ConfigValidator interface {
Validate(cfg *Config) []ConfigError
}
ConfigValidator validates a Config and returns any errors found.
type DecayConfig ¶
type EmbeddingsConfig ¶
type LLMConfig ¶
type LLMConfig struct {
Enabled bool `toml:"enabled"`
Provider string `toml:"provider"`
Model string `toml:"model"`
APIKeyEnv string `toml:"api_key_env"`
}
LLMConfig is optional. Yaad is a memory layer — it does NOT call LLMs directly. This config is reserved for future summarization hooks.
type MemoryConfig ¶
type SearchConfig ¶
type ServerConfig ¶
type ValidationErrorType ¶
type ValidationErrorType int
ValidationErrorType categorizes the kind of validation problem.
const ( MissingRequired ValidationErrorType = iota // A required field is absent or zero-value. InvalidValue // A field has an invalid or malformed value. OutOfRange // A numeric field is outside its acceptable range. IncompatibleFields // Two or more fields conflict with each other. UnknownField // A TOML key is not recognized. )
func (ValidationErrorType) String ¶
func (t ValidationErrorType) String() string