config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConfigFile = errors.New("no config file found")

ErrNoConfigFile is returned when no config file is found in any of the search locations.

Functions

This section is empty.

Types

type ChromaConfig

type ChromaConfig struct {
	URL      string
	Host     string
	Port     string
	Tenant   string
	Database string
	Timeout  time.Duration
}

ChromaConfig holds ChromaDB connection settings.

type Config

type Config struct {
	Chroma  ChromaConfig
	Model   ModelConfig
	Logging LoggingConfig
}

Config holds all configuration for cmdChroma.

func LoadConfig

func LoadConfig(c *cli.Command) (*Config, error)

LoadConfig loads configuration from all sources with proper precedence: CLI flags > Environment variables > Local config > Global config > Defaults

func (*Config) ConfigForEmbedder

func (cfg *Config) ConfigForEmbedder() (modelPath, tokenizerPath, libPath string)

ConfigForEmbedder returns paths needed by the embedder.

func (*Config) GetChromaURL

func (cfg *Config) GetChromaURL() string

GetChromaURL returns the full ChromaDB URL.

func (*Config) GetDatabase

func (cfg *Config) GetDatabase() string

GetDatabase returns the database name.

func (*Config) GetEmbedderLib

func (cfg *Config) GetEmbedderLib() string

GetEmbedderLib returns the path to the ONNX runtime library.

func (*Config) GetEmbedderModel

func (cfg *Config) GetEmbedderModel() string

GetEmbedderModel returns the path to the ONNX model.

func (*Config) GetEmbedderTokenizer

func (cfg *Config) GetEmbedderTokenizer() string

GetEmbedderTokenizer returns the path to the tokenizer JSON.

func (*Config) GetTenant

func (cfg *Config) GetTenant() string

GetTenant returns the tenant name.

func (*Config) IsVerbose

func (cfg *Config) IsVerbose() bool

IsVerbose returns whether verbose logging is enabled.

type ConfigFile

type ConfigFile struct {
	Version  string             `yaml:"version"`
	Chroma   ConfigFileChroma   `yaml:"chroma"`
	Model    ConfigFileModel    `yaml:"model"`
	Logging  ConfigFileLogging  `yaml:"logging"`
	Features ConfigFileFeatures `yaml:"features"`
}

ConfigFile represents the structure of a YAML configuration file on disk.

type ConfigFileChroma

type ConfigFileChroma struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Tenant   string `yaml:"tenant"`
	Database string `yaml:"database"`
	Timeout  int    `yaml:"timeout"`
}

ConfigFileChroma represents the chroma section in the YAML config file.

type ConfigFileCreateCollection

type ConfigFileCreateCollection struct {
	AutoCreateDatabase bool `yaml:"auto_create_database"`
}

ConfigFileCreateCollection represents feature flags for create_collection.

type ConfigFileFeatures

type ConfigFileFeatures struct {
	CreateCollection ConfigFileCreateCollection `yaml:"create_collection"`
}

ConfigFileFeatures represents the features section in the YAML config file.

type ConfigFileLogging

type ConfigFileLogging struct {
	Level   string `yaml:"level"`
	Format  string `yaml:"format"`
	Verbose bool   `yaml:"verbose"`
}

ConfigFileLogging represents the logging section in the YAML config file.

type ConfigFileModel

type ConfigFileModel struct {
	ONNXModel string `yaml:"onnx_model"`
	Tokenizer string `yaml:"tokenizer"`
	ONNXLib   string `yaml:"onnx_lib"`
}

ConfigFileModel represents the model section in the YAML config file.

type LoggingConfig

type LoggingConfig struct {
	Verbose bool
	Level   string
	Format  string
}

LoggingConfig controls logging behavior.

type ModelConfig

type ModelConfig struct {
	ONNXModel string
	Tokenizer string
	ONNXLib   string
}

ModelConfig holds paths to embedding model and tokenizer.

Jump to

Keyboard shortcuts

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