config

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 8 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

View Source
var (
	ErrGeneratedSchemaIsNil = errors.New("generated JSON Schema is nil")
)

Functions

func JSONSchema added in v0.17.0

func JSONSchema() ([]byte, error)

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 AvailableIndexes added in v0.13.0

type AvailableIndexes struct {
	IVFFLAT bool `mapstructure:"ivfflat"`
	HSNW    bool `mapstructure:"hsnw"`
}

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"`
	OpenTelemetry OpenTelemetryConfig `mapstructure:"opentelemetry"`
	DataConfig    DataConfig          `mapstructure:"data"`
	Development   bool                `mapstructure:"development"`
	CustomPrompts CustomPromptsConfig `mapstructure:"custom_prompts"`
}

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 CustomPromptsConfig added in v0.13.0

type CustomPromptsConfig struct {
	SummarizerPrompts ExtractorPromptsConfig `mapstructure:"summarizer_prompts"`
}

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"`
	// ChunkSize is the number of documents to embed in a single task.
	ChunkSize int `mapstructure:"chunk_size"`
}

type EntityExtractorConfig added in v0.5.0

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

type ExtractorPromptsConfig added in v0.13.0

type ExtractorPromptsConfig struct {
	OpenAI    string `mapstructure:"openai"`
	Anthropic string `mapstructure:"anthropic"`
}

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 OpenTelemetryConfig added in v0.19.0

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

type PostgresConfig

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

type ServerConfig

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

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"`
	Embeddings EmbeddingsConfig      `mapstructure:"embeddings"`
	Entities   EntityExtractorConfig `mapstructure:"entities"`
}

Jump to

Keyboard shortcuts

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