config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the configuration file path

Types

type AnthropicConfig

type AnthropicConfig struct {
	APIKey      string        `mapstructure:"api_key"`
	BaseURL     string        `mapstructure:"base_url"`
	Model       string        `mapstructure:"model"`
	MaxTokens   int           `mapstructure:"max_tokens"`
	Temperature float64       `mapstructure:"temperature"`
	Timeout     time.Duration `mapstructure:"timeout"`
}

AnthropicConfig represents Anthropic configuration

type AppConfig

type AppConfig struct {
	Name        string `mapstructure:"name"`
	Version     string `mapstructure:"version"`
	Environment string `mapstructure:"environment"`
	Port        int    `mapstructure:"port"`
	Host        string `mapstructure:"host"`
	Debug       bool   `mapstructure:"debug"`
}

AppConfig represents application-level configuration

type AsyncConfig

type AsyncConfig struct {
	Enabled    bool          `mapstructure:"enabled"`
	QueueName  string        `mapstructure:"queue_name"`
	MaxRetries int           `mapstructure:"max_retries"`
	RetryDelay time.Duration `mapstructure:"retry_delay"`
}

AsyncConfig represents async processing configuration

type AuthConfig

type AuthConfig struct {
	JWT       JWTConfig       `mapstructure:"jwt"`
	RateLimit RateLimitConfig `mapstructure:"rate_limit"`
}

AuthConfig represents authentication configuration

type Config

type Config struct {
	App         AppConfig         `mapstructure:"app"`
	Logging     LoggingConfig     `mapstructure:"logging"`
	Database    DatabaseConfig    `mapstructure:"database"`
	LLM         LLMConfig         `mapstructure:"llm"`
	Auth        AuthConfig        `mapstructure:"auth"`
	Retrieval   RetrievalConfig   `mapstructure:"retrieval"`
	Ingestion   IngestionConfig   `mapstructure:"ingestion"`
	Session     SessionConfig     `mapstructure:"session"`
	Monitoring  MonitoringConfig  `mapstructure:"monitoring"`
	Development DevelopmentConfig `mapstructure:"development"`
}

Config represents the application configuration

func LoadConfig

func LoadConfig(configPath ...string) (*Config, error)

LoadConfig loads configuration from file, environment variables, and defaults

func (*Config) GetDatabaseURL

func (c *Config) GetDatabaseURL() string

GetDatabaseURL returns the appropriate database URL

func (*Config) GetRedisURL

func (c *Config) GetRedisURL() string

GetRedisURL returns the Redis URL

func (*Config) IsDevelopment

func (c *Config) IsDevelopment() bool

IsDevelopment returns true if running in development mode

func (*Config) IsProduction

func (c *Config) IsProduction() bool

IsProduction returns true if running in production mode

type ConflictResolutionConfig

type ConflictResolutionConfig struct {
	Enabled             bool    `mapstructure:"enabled"`
	Strategy            string  `mapstructure:"strategy"`
	ConfidenceThreshold float64 `mapstructure:"confidence_threshold"`
}

ConflictResolutionConfig represents conflict resolution configuration

type ContextConfig

type ContextConfig struct {
	MaxTokens       int    `mapstructure:"max_tokens"`
	IncludeMetadata bool   `mapstructure:"include_metadata"`
	Format          string `mapstructure:"format"`
}

ContextConfig represents context building configuration

type DatabaseConfig

type DatabaseConfig struct {
	SurrealDB SurrealDBConfig `mapstructure:"surrealdb"`
	Redis     RedisConfig     `mapstructure:"redis"`
}

DatabaseConfig represents database configuration

type DevelopmentConfig

type DevelopmentConfig struct {
	AutoReload     bool `mapstructure:"auto_reload"`
	Profiling      bool `mapstructure:"profiling"`
	MockLLM        bool `mapstructure:"mock_llm"`
	LoadSampleData bool `mapstructure:"load_sample_data"`
}

DevelopmentConfig represents development-specific configuration

type EntityExtractionConfig

type EntityExtractionConfig struct {
	Enabled             bool    `mapstructure:"enabled"`
	BatchSize           int     `mapstructure:"batch_size"`
	ConfidenceThreshold float64 `mapstructure:"confidence_threshold"`
}

EntityExtractionConfig represents entity extraction configuration

type HealthConfig

type HealthConfig struct {
	Enabled bool   `mapstructure:"enabled"`
	Path    string `mapstructure:"path"`
}

HealthConfig represents health check configuration

type IngestionConfig

type IngestionConfig struct {
	Async              AsyncConfig              `mapstructure:"async"`
	EntityExtraction   EntityExtractionConfig   `mapstructure:"entity_extraction"`
	ConflictResolution ConflictResolutionConfig `mapstructure:"conflict_resolution"`
}

IngestionConfig represents ingestion configuration

type JWTConfig

type JWTConfig struct {
	Secret string        `mapstructure:"secret"`
	Expiry time.Duration `mapstructure:"expiry"`
	Issuer string        `mapstructure:"issuer"`
}

JWTConfig represents JWT configuration

type LLMConfig

type LLMConfig struct {
	DefaultProvider string          `mapstructure:"default_provider"`
	OpenAI          OpenAIConfig    `mapstructure:"openai"`
	Anthropic       AnthropicConfig `mapstructure:"anthropic"`
}

LLMConfig represents LLM service configuration

type LoggingConfig

type LoggingConfig struct {
	Level    string `mapstructure:"level"`
	Format   string `mapstructure:"format"`
	Output   string `mapstructure:"output"`
	FilePath string `mapstructure:"file_path"`
}

LoggingConfig represents logging configuration

type MetricsConfig

type MetricsConfig struct {
	Enabled bool   `mapstructure:"enabled"`
	Port    int    `mapstructure:"port"`
	Path    string `mapstructure:"path"`
}

MetricsConfig represents metrics configuration

type MonitoringConfig

type MonitoringConfig struct {
	Metrics MetricsConfig `mapstructure:"metrics"`
	Health  HealthConfig  `mapstructure:"health"`
	Tracing TracingConfig `mapstructure:"tracing"`
}

MonitoringConfig represents monitoring configuration

type OpenAIConfig

type OpenAIConfig struct {
	APIKey              string        `mapstructure:"api_key"`
	BaseURL             string        `mapstructure:"base_url"`
	Model               string        `mapstructure:"model"`
	EmbeddingAPIKey     string        `mapstructure:"embedding_api_key"`
	EmbeddingModel      string        `mapstructure:"embedding_model"`
	EmbeddingBaseURL    string        `mapstructure:"embedding_base_url"`
	EmbeddingDimensions int           `mapstructure:"embedding_dimensions"`
	MaxTokens           int           `mapstructure:"max_tokens"`
	Temperature         float64       `mapstructure:"temperature"`
	Timeout             time.Duration `mapstructure:"timeout"`
}

OpenAIConfig represents OpenAI configuration

type RateLimitConfig

type RateLimitConfig struct {
	Enabled           bool `mapstructure:"enabled"`
	RequestsPerMinute int  `mapstructure:"requests_per_minute"`
	Burst             int  `mapstructure:"burst"`
}

RateLimitConfig represents rate limiting configuration

type RedisConfig

type RedisConfig struct {
	URL        string        `mapstructure:"url"`
	Password   string        `mapstructure:"password"`
	Database   int           `mapstructure:"database"`
	MaxRetries int           `mapstructure:"max_retries"`
	PoolSize   int           `mapstructure:"pool_size"`
	Timeout    time.Duration `mapstructure:"timeout"`
}

RedisConfig represents Redis configuration

type RerankingConfig

type RerankingConfig struct {
	Enabled            bool    `mapstructure:"enabled"`
	Algorithm          string  `mapstructure:"algorithm"`
	TopK               int     `mapstructure:"top_k"`
	DiversityThreshold float64 `mapstructure:"diversity_threshold"`
}

RerankingConfig represents reranking configuration

type RetrievalConfig

type RetrievalConfig struct {
	Search    SearchConfig    `mapstructure:"search"`
	Reranking RerankingConfig `mapstructure:"reranking"`
	Context   ContextConfig   `mapstructure:"context"`
}

RetrievalConfig represents retrieval configuration

type SearchConfig

type SearchConfig struct {
	MaxResults          int     `mapstructure:"max_results"`
	SimilarityThreshold float64 `mapstructure:"similarity_threshold"`
	BM25Weight          float64 `mapstructure:"bm25_weight"`
	VectorWeight        float64 `mapstructure:"vector_weight"`
	GraphWeight         float64 `mapstructure:"graph_weight"`
}

SearchConfig represents search configuration

type SessionConfig

type SessionConfig struct {
	Storage              string        `mapstructure:"storage"`
	TTL                  time.Duration `mapstructure:"ttl"`
	CleanupInterval      time.Duration `mapstructure:"cleanup_interval"`
	MaxSessionsPerTenant int           `mapstructure:"max_sessions_per_tenant"`
	MaxMemoryPerSession  string        `mapstructure:"max_memory_per_session"`
}

SessionConfig represents session management configuration

type SurrealDBConfig

type SurrealDBConfig struct {
	URL            string        `mapstructure:"url"`
	Namespace      string        `mapstructure:"namespace"`
	Database       string        `mapstructure:"database"`
	Username       string        `mapstructure:"username"`
	Password       string        `mapstructure:"password"`
	Timeout        time.Duration `mapstructure:"timeout"`
	MaxConnections int           `mapstructure:"max_connections"`
}

SurrealDBConfig represents SurrealDB configuration

type TracingConfig

type TracingConfig struct {
	Enabled        bool   `mapstructure:"enabled"`
	JaegerEndpoint string `mapstructure:"jaeger_endpoint"`
}

TracingConfig represents tracing configuration

Jump to

Keyboard shortcuts

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