Documentation
¶
Index ¶
- Constants
- func FormatConfigError(err error) string
- func GetConfigFile() string
- func GetEnvFile() string
- func InteractiveConfigFix(envFileExists bool) error
- func InterpolateString(s string) string
- func PromptToFixConfig(err *ConfigError) (bool, error)
- type Collection
- type Config
- func (c *Config) GetAllSchemas() []SchemaDefinition
- func (c *Config) GetDatabase(name string) (*VectorDBConfig, error)
- func (c *Config) GetDatabaseNames() map[string]VectorDBType
- func (c *Config) GetDefaultDatabase() (*VectorDBConfig, error)
- func (c *Config) GetSchema(name string) (*SchemaDefinition, error)
- func (c *Config) ListDatabases() []string
- func (c *Config) ListSchemas() []string
- type ConfigError
- type DatabasesConfig
- type LoadConfigOptions
- type MockCollection
- type MockConfig
- type SchemaDefinition
- type VectorDBConfig
- type VectorDBType
Constants ¶
const ( DefaultTextCollection = "WeaveDocs" DefaultImageCollection = "WeaveImages" DefaultDatabaseType = "weaviate-cloud" DefaultLocalURL = "http://localhost:8080" DefaultBatchWorkers = 3 DefaultRetryAttempts = 3 DefaultLLMModel = "gpt-4o" DefaultLLMTimeout = 300 DefaultBatchChunkSize = 500 DefaultImageQuality = 85 DefaultMaxImageSize = 2048 DefaultEmbeddingDim = 384 DefaultTimeout = 10 // Default timeout in seconds for vector DB operations )
Default configuration values
Variables ¶
This section is empty.
Functions ¶
func FormatConfigError ¶ added in v0.3.6
FormatConfigError formats a configuration error with helpful tips
func GetConfigFile ¶
func GetConfigFile() string
GetConfigFile returns the path to the config file being used
func InteractiveConfigFix ¶ added in v0.3.6
InteractiveConfigFix runs the interactive configuration fix process
func InterpolateString ¶
InterpolateString interpolates environment variables in a string
func PromptToFixConfig ¶ added in v0.3.6
func PromptToFixConfig(err *ConfigError) (bool, error)
PromptToFixConfig prompts the user to fix configuration interactively
Types ¶
type Collection ¶ added in v0.0.4
type Collection struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Description string `yaml:"description,omitempty"`
}
Collection represents a collection configuration
type Config ¶
type Config struct {
Databases DatabasesConfig `yaml:"databases"`
SchemasDir string `yaml:"schemas_dir,omitempty"`
}
Config holds the complete application configuration
func LoadConfig ¶
func LoadConfigWithOptions ¶ added in v0.1.6
func LoadConfigWithOptions(opts LoadConfigOptions) (*Config, error)
func (*Config) GetAllSchemas ¶ added in v0.2.6
func (c *Config) GetAllSchemas() []SchemaDefinition
GetAllSchemas returns all configured schema definitions
func (*Config) GetDatabase ¶ added in v0.0.4
func (c *Config) GetDatabase(name string) (*VectorDBConfig, error)
GetDatabase returns a specific vector database configuration by name
func (*Config) GetDatabaseNames ¶ added in v0.0.4
func (c *Config) GetDatabaseNames() map[string]VectorDBType
GetDatabaseNames returns a map of database names to their types
func (*Config) GetDefaultDatabase ¶ added in v0.0.4
func (c *Config) GetDefaultDatabase() (*VectorDBConfig, error)
GetDefaultDatabase returns the default vector database configuration
func (*Config) GetSchema ¶ added in v0.2.5
func (c *Config) GetSchema(name string) (*SchemaDefinition, error)
GetSchema returns a specific schema definition by name
func (*Config) ListDatabases ¶ added in v0.0.4
ListDatabases returns a list of all configured database names
func (*Config) ListSchemas ¶ added in v0.2.5
ListSchemas returns a list of all configured schema names
type ConfigError ¶ added in v0.3.6
type ConfigError struct {
Message string
MissingVars []string
EnvFileExists bool
ConfigFileExists bool
Tips []string
}
ConfigError represents a configuration error with helpful information
func CheckREPLRequiredEnvVars ¶ added in v0.3.6
func CheckREPLRequiredEnvVars() *ConfigError
CheckREPLRequiredEnvVars checks if REPL-specific environment variables are set
func CheckRequiredEnvVars ¶ added in v0.3.6
func CheckRequiredEnvVars() *ConfigError
CheckRequiredEnvVars checks if required environment variables are set
func (*ConfigError) Error ¶ added in v0.3.6
func (e *ConfigError) Error() string
Error implements the error interface
type DatabasesConfig ¶ added in v0.0.4
type DatabasesConfig struct {
Default string `yaml:"default"`
VectorDatabases []VectorDBConfig `yaml:"vector_databases"`
Schemas []SchemaDefinition `yaml:"schemas,omitempty"`
}
DatabasesConfig holds multiple databases configuration
type LoadConfigOptions ¶ added in v0.1.6
type LoadConfigOptions struct {
ConfigFile string
EnvFile string
VectorDBType string
WeaviateAPIKey string
WeaviateURL string
Timeout string // Timeout as duration string (e.g., "5s", "10s") or empty for default
}
LoadConfig loads configuration from files and environment variables LoadConfigOptions holds options for loading configuration
type MockCollection ¶
type MockCollection struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Description string `yaml:"description"`
}
MockCollection represents a mock collection (for backward compatibility)
type MockConfig ¶
type MockConfig struct {
Enabled bool `yaml:"enabled"`
SimulateEmbeddings bool `yaml:"simulate_embeddings"`
EmbeddingDimension int `yaml:"embedding_dimension"`
Collections []MockCollection `yaml:"collections"`
}
MockConfig holds mock database configuration (for backward compatibility)
type SchemaDefinition ¶ added in v0.2.5
type SchemaDefinition struct {
Name string `yaml:"name"`
Schema map[string]interface{} `yaml:"schema"`
Metadata map[string]interface{} `yaml:"metadata,omitempty"`
}
SchemaDefinition represents a named schema that can be used to create collections
type VectorDBConfig ¶
type VectorDBConfig struct {
Name string `yaml:"name"`
Type VectorDBType `yaml:"type"`
URL string `yaml:"url,omitempty"`
APIKey string `yaml:"api_key,omitempty"`
OpenAIAPIKey string `yaml:"openai_api_key,omitempty"`
Timeout int `yaml:"timeout,omitempty"` // Timeout in seconds for DB operations
Enabled bool `yaml:"enabled,omitempty"`
SimulateEmbeddings bool `yaml:"simulate_embeddings,omitempty"`
EmbeddingDimension int `yaml:"embedding_dimension,omitempty"`
Collections []Collection `yaml:"collections"`
}
VectorDBConfig holds vector database configuration
type VectorDBType ¶
type VectorDBType string
VectorDBType represents the type of vector database
const ( VectorDBTypeCloud VectorDBType = "weaviate-cloud" VectorDBTypeLocal VectorDBType = "weaviate-local" VectorDBTypeMock VectorDBType = "mock" )