config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigFile

func GetConfigFile() string

GetConfigFile returns the path to the config file being used

func GetEnvFile

func GetEnvFile() string

GetEnvFile returns the path to the env file being used

func InterpolateString

func InterpolateString(s string) string

InterpolateString interpolates environment variables in a string

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"`
}

Config holds the complete application configuration

func LoadConfig

func LoadConfig(configFile, envFile string) (*Config, error)

LoadConfig loads configuration from files and environment variables

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) ListDatabases added in v0.0.4

func (c *Config) ListDatabases() []string

ListDatabases returns a list of all configured database names

type DatabasesConfig added in v0.0.4

type DatabasesConfig struct {
	Default         string           `yaml:"default"`
	VectorDatabases []VectorDBConfig `yaml:"vector_databases"`
}

DatabasesConfig holds multiple databases 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 VectorDBConfig

type VectorDBConfig struct {
	Name               string       `yaml:"name"`
	Type               VectorDBType `yaml:"type"`
	URL                string       `yaml:"url,omitempty"`
	APIKey             string       `yaml:"api_key,omitempty"`
	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"
)

Jump to

Keyboard shortcuts

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