Documentation
¶
Index ¶
- func GetDefaultConfigPath() string
- func GetEnv(key, defaultValue string) string
- func SanitizeAPIKey(apiKey string) string
- func Validate(cfg *Config) error
- type AnthropicConfig
- type AzureOpenAIConfig
- type CohereConfig
- type Config
- type EmbeddingConfig
- type LLMConfig
- type Loader
- type LoggingConfig
- type MemoryConfig
- type MilvusConfig
- type OllamaConfig
- type OpenAIConfig
- type PineconeConfig
- type QdrantConfig
- type RAGConfig
- type ValidationError
- type Validator
- type VectorStoreConfig
- type VoyageConfig
- type WeaviateConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultConfigPath ¶
func GetDefaultConfigPath() string
GetDefaultConfigPath returns the default configuration file path
func SanitizeAPIKey ¶
SanitizeAPIKey sanitizes API keys for logging
Types ¶
type AnthropicConfig ¶
type AnthropicConfig struct {
APIKey string `yaml:"apiKey"`
Model string `yaml:"model" default:"claude-3-opus-20240229"`
BaseURL string `yaml:"baseURL" default:"https://api.anthropic.com/v1"`
}
AnthropicConfig represents Anthropic configuration
type AzureOpenAIConfig ¶
type AzureOpenAIConfig struct {
APIKey string `yaml:"apiKey"`
Model string `yaml:"model"`
Endpoint string `yaml:"endpoint"`
APIVersion string `yaml:"apiVersion" default:"2024-03-01-preview"`
}
AzureOpenAIConfig represents Azure OpenAI configuration
type CohereConfig ¶ added in v0.6.0
type CohereConfig struct {
APIKey string `yaml:"apiKey"`
Model string `yaml:"model" default:"embed-english-v3.0"`
BaseURL string `yaml:"baseURL" default:"https://api.cohere.ai/v1"`
}
CohereConfig represents Cohere configuration
type Config ¶
type Config struct {
RAG RAGConfig `yaml:"rag"`
Embedding EmbeddingConfig `yaml:"embedding"`
LLM LLMConfig `yaml:"llm"`
VectorStore VectorStoreConfig `yaml:"vectorstore"`
Logging LoggingConfig `yaml:"logging"`
}
Config represents the main configuration structure for GoRAG
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
SetDefaults sets default values for configuration
type EmbeddingConfig ¶
type EmbeddingConfig struct {
Provider string `yaml:"provider" default:"openai"`
OpenAI OpenAIConfig `yaml:"openai"`
Ollama OllamaConfig `yaml:"ollama"`
Cohere CohereConfig `yaml:"cohere"`
Voyage VoyageConfig `yaml:"voyage"`
}
EmbeddingConfig represents embedding provider configuration
type LLMConfig ¶
type LLMConfig struct {
Provider string `yaml:"provider" default:"openai"`
OpenAI OpenAIConfig `yaml:"openai"`
Anthropic AnthropicConfig `yaml:"anthropic"`
Ollama OllamaConfig `yaml:"ollama"`
AzureOpenAI AzureOpenAIConfig `yaml:"azure_openai"`
}
LLMConfig represents LLM client configuration
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader represents a configuration loader
type LoggingConfig ¶
type LoggingConfig struct {
Level string `yaml:"level" default:"info"`
Format string `yaml:"format" default:"json"`
}
LoggingConfig represents logging configuration
type MemoryConfig ¶
type MemoryConfig struct {
MaxSize int `yaml:"maxSize" default:"10000"`
}
MemoryConfig represents memory vector store configuration
type MilvusConfig ¶
type MilvusConfig struct {
Host string `yaml:"host" default:"localhost"`
Port string `yaml:"port" default:"19530"`
Username string `yaml:"username"`
Password string `yaml:"password"`
Database string `yaml:"database" default:"default"`
}
MilvusConfig represents Milvus vector store configuration
type OllamaConfig ¶
type OllamaConfig struct {
Model string `yaml:"model" default:"qwen3:7b"`
BaseURL string `yaml:"baseURL" default:"http://localhost:11434"`
}
OllamaConfig represents Ollama configuration
type OpenAIConfig ¶
type OpenAIConfig struct {
APIKey string `yaml:"apiKey"`
Model string `yaml:"model" default:"text-embedding-ada-002"`
BaseURL string `yaml:"baseURL" default:"https://api.openai.com/v1"`
}
OpenAIConfig represents OpenAI configuration
type PineconeConfig ¶
type PineconeConfig struct {
APIKey string `yaml:"apiKey"`
Environment string `yaml:"environment"`
}
PineconeConfig represents Pinecone vector store configuration
type QdrantConfig ¶
type QdrantConfig struct {
URL string `yaml:"url" default:"http://localhost:6333"`
APIKey string `yaml:"apiKey"`
}
QdrantConfig represents Qdrant vector store configuration
type RAGConfig ¶
type RAGConfig struct {
TopK int `yaml:"topK" default:"5"`
ChunkSize int `yaml:"chunkSize" default:"1000"`
ChunkOverlap int `yaml:"chunkOverlap" default:"100"`
UseSemanticChunking bool `yaml:"useSemanticChunking" default:"false"`
UseHyDE bool `yaml:"useHyDE" default:"false"`
UseRAGFusion bool `yaml:"useRAGFusion" default:"false"`
UseContextCompression bool `yaml:"useContextCompression" default:"false"`
RAGFusionQueries int `yaml:"ragFusionQueries" default:"4"`
RAGFusionWeight float64 `yaml:"ragFusionWeight" default:"0.5"`
}
RAGConfig represents RAG engine configuration
type ValidationError ¶ added in v0.6.0
ValidationError represents a configuration validation error
func (ValidationError) Error ¶ added in v0.6.0
func (e ValidationError) Error() string
Error implements the error interface
type Validator ¶ added in v0.6.0
type Validator struct {
// contains filtered or unexported fields
}
Validator validates configuration
func NewValidator ¶ added in v0.6.0
func NewValidator() *Validator
NewValidator creates a new validator
func (*Validator) Error ¶ added in v0.6.0
func (v *Validator) Error() *errors.GoRAGError
Error returns a formatted error message
func (*Validator) Errors ¶ added in v0.6.0
func (v *Validator) Errors() []ValidationError
Errors returns all validation errors
type VectorStoreConfig ¶
type VectorStoreConfig struct {
Type string `yaml:"type" default:"memory"`
Memory MemoryConfig `yaml:"memory"`
Milvus MilvusConfig `yaml:"milvus"`
Qdrant QdrantConfig `yaml:"qdrant"`
Weaviate WeaviateConfig `yaml:"weaviate"`
Pinecone PineconeConfig `yaml:"pinecone"`
}
VectorStoreConfig represents vector store configuration
type VoyageConfig ¶ added in v0.6.0
type VoyageConfig struct {
APIKey string `yaml:"apiKey"`
Model string `yaml:"model" default:"voyage-2"`
BaseURL string `yaml:"baseURL" default:"https://api.voyageai.com/v1"`
}
VoyageConfig represents Voyage configuration
type WeaviateConfig ¶
type WeaviateConfig struct {
URL string `yaml:"url" default:"http://localhost:8080"`
APIKey string `yaml:"apiKey"`
}
WeaviateConfig represents Weaviate vector store configuration