config

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version       = "dev"
	CommitHash    = "n/a"
	BuildTime     = "n/a"
	VersionString = fmt.Sprintf("%s-%s (%s)", Version, CommitHash, BuildTime)
)
View Source
var EnvVars = map[string]string{
	"llm.anthropic_api_key": "ZEP_ANTHROPIC_API_KEY",
	"llm.openai_api_key":    "ZEP_OPENAI_API_KEY",
	"auth.secret":           "ZEP_AUTH_SECRET",
	"development":           "ZEP_DEVELOPMENT",
}

EnvVars is a set of secrets that should be stored in the environment, not config file

Functions

func SetLogLevel

func SetLogLevel(cfg *Config)

SetLogLevel sets the log level based on the config file. Defaults to INFO if not set or invalid

Types

type AuthConfig added in v0.7.1

type AuthConfig struct {
	Secret   string `mapstructure:"secret"`
	Required bool   `mapstructure:"required"`
}

type AzureOpenAIConfig added in v0.11.0

type AzureOpenAIConfig struct {
	LLMDeployment       string `mapstructure:"llm_deployment"`
	EmbeddingDeployment string `mapstructure:"embedding_deployment"`
}

type Config

type Config struct {
	LLM         LLM              `mapstructure:"llm"`
	NLP         NLP              `mapstructure:"nlp"`
	Memory      MemoryConfig     `mapstructure:"memory"`
	Extractors  ExtractorsConfig `mapstructure:"extractors"`
	Store       StoreConfig      `mapstructure:"store"`
	Server      ServerConfig     `mapstructure:"server"`
	Log         LogConfig        `mapstructure:"log"`
	Auth        AuthConfig       `mapstructure:"auth"`
	DataConfig  DataConfig       `mapstructure:"data"`
	Development bool             `mapstructure:"development"`
}

Config holds the configuration of the application Use cmd.NewConfig to create a new instance

func LoadConfig

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

LoadConfig loads the config file and ENV variables into a Config struct

type DataConfig added in v0.7.1

type DataConfig struct {
	// PurgeEvery is the period between hard deletes, in minutes.
	// If set to 0, hard deletes will not be performed.
	PurgeEvery int `mapstructure:"purge_every"`
}

type DocumentExtractorsConfig added in v0.9.0

type DocumentExtractorsConfig struct {
	Embeddings EmbeddingsConfig `mapstructure:"embeddings"`
}

type EmbeddingsConfig

type EmbeddingsConfig struct {
	Enabled    bool   `mapstructure:"enabled"`
	Dimensions int    `mapstructure:"dimensions"`
	Service    string `mapstructure:"service"`
}

type EntityExtractorConfig added in v0.5.0

type EntityExtractorConfig struct {
	Enabled bool `mapstructure:"enabled"`
}

type ExtractorsConfig

type ExtractorsConfig struct {
	Messages  MessageExtractorsConfig  `mapstructure:"messages"`
	Documents DocumentExtractorsConfig `mapstructure:"documents"`
}

type IntentExtractorConfig added in v0.7.0

type IntentExtractorConfig struct {
	Enabled bool `mapstructure:"enabled"`
}

type LLM

type LLM struct {
	Service             string            `mapstructure:"service"`
	Model               string            `mapstructure:"model"`
	AnthropicAPIKey     string            `mapstructure:"anthropic_api_key"`
	OpenAIAPIKey        string            `mapstructure:"openai_api_key"`
	AzureOpenAIEndpoint string            `mapstructure:"azure_openai_endpoint"`
	AzureOpenAIModel    AzureOpenAIConfig `mapstructure:"azure_openai"`
	OpenAIEndpoint      string            `mapstructure:"openai_endpoint"`
	OpenAIOrgID         string            `mapstructure:"openai_org_id"`
}

type LogConfig

type LogConfig struct {
	Level string `mapstructure:"level"`
}

type MemoryConfig

type MemoryConfig struct {
	MessageWindow int `mapstructure:"message_window"`
}

type MessageExtractorsConfig added in v0.9.0

type MessageExtractorsConfig struct {
	Summarizer SummarizerConfig      `mapstructure:"summarizer"`
	Embeddings EmbeddingsConfig      `mapstructure:"embeddings"`
	Entities   EntityExtractorConfig `mapstructure:"entities"`
	Intent     IntentExtractorConfig `mapstructure:"intent"`
}

MessageExtractorsConfig holds the configuration for all extractors

type NLP added in v0.5.0

type NLP struct {
	ServerURL string `mapstructure:"server_url"`
}

type PostgresConfig

type PostgresConfig struct {
	DSN string `mapstructure:"dsn"`
}

type ServerConfig

type ServerConfig struct {
	Host       string `mapstructure:"host"`
	Port       int    `mapstructure:"port"`
	WebEnabled bool   `mapstructure:"web_enabled"`
}

type StoreConfig added in v0.9.0

type StoreConfig struct {
	Type     string         `mapstructure:"type"`
	Postgres PostgresConfig `mapstructure:"postgres"`
}

type SummarizerConfig

type SummarizerConfig struct {
	Enabled bool `mapstructure:"enabled"`
}

Jump to

Keyboard shortcuts

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