config

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProxyPort               = 8080
	DefaultExtractionBufferBytes   = 16384 // 16KB default
	DefaultLLMBaseURL              = "http://localhost:11434/v1"
	DefaultEmbeddingModel          = "nomic-embed-text"
	DefaultHybridWeight            = 0.5
	DefaultCoVeConfidenceThreshold = 0.6
	DefaultCoVeMaxCandidates       = 20
	DefaultCoVeTimeoutSeconds      = 30
	DefaultCoVeModel               = "" // Empty = use default LLM
)

Variables

This section is empty.

Functions

func EnsureTinyMemDirs

func EnsureTinyMemDirs(tinyMemDir string) error

EnsureTinyMemDirs creates the necessary .tinyMem subdirectories

func FindProjectRoot

func FindProjectRoot() (string, error)

FindProjectRoot looks for the .tinyMem directory starting from the current working directory and moving up the directory tree

func GenerateProjectID

func GenerateProjectID(projectRoot string) string

GenerateProjectID creates a consistent project ID from the project root path. It uses the absolute path to ensure uniqueness across different working directories but normalizes it to be filesystem-agnostic for consistency (e.g., replaces backslashes with forward slashes).

func GetTinyMemDir

func GetTinyMemDir(projectRoot string) string

GetTinyMemDir returns the path to the .tinyMem directory relative to the project root

func WithConfig

func WithConfig(ctx context.Context, cfg *Config) context.Context

WithConfig adds the config to the context

Types

type Config

type Config struct {
	ProxyPort                     int
	LLMBaseURL                    string
	LLMAPIKey                     string
	LLMModel                      string
	EmbeddingBaseURL              string
	EmbeddingModel                string
	SemanticEnabled               bool
	HybridWeight                  float64
	EvidenceAllowCommand          bool
	EvidenceAllowedCommands       []string
	EvidenceCommandTimeoutSeconds int
	SearchEnabled                 bool
	Streaming                     bool
	LogLevel                      string
	LogFile                       string
	DBPath                        string
	ConfigPath                    string
	TinyMemDir                    string
	ProjectRoot                   string
	ExtractionBufferBytes         int
	RecallMaxItems                int
	RecallMaxTokens               int
	// Metrics configuration
	MetricsEnabled bool
	// CoVe (Chain-of-Verification) configuration
	CoVeEnabled             bool
	CoVeConfidenceThreshold float64
	CoVeMaxCandidates       int
	CoVeTimeoutSeconds      int
	CoVeModel               string
	CoVeRecallFilterEnabled bool
}

Config holds the application configuration

func FromContext

func FromContext(ctx context.Context) *Config

FromContext retrieves the config from the context

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads configuration from file, environment variables, and defaults

func (*Config) Validate

func (c *Config) Validate() error

Validate verifies the configuration is usable.

Jump to

Keyboard shortcuts

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