configs

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvTimezoneShiftSeconds = "TIMEZONE_SHIFT_SECONDS"

	EnvTelegramBotToken       = "TELEGRAM_BOT_TOKEN"       //nolint:gosec
	EnvTelegramBotWebhookURL  = "TELEGRAM_BOT_WEBHOOK_URL" //nolint:gosec
	EnvTelegramBotWebhookPort = "TELEGRAM_BOT_WEBHOOK_PORT"
	EnvTelegramBotAPIEndpoint = "TELEGRAM_BOT_API_ENDPOINT"

	EnvSlackClientID     = "SLACK_CLIENT_ID"
	EnvSlackClientSecret = "SLACK_CLIENT_SECRET"
	EnvSlackWebhookPort  = "SLACK_WEBHOOK_PORT"

	EnvDiscordBotToken       = "DISCORD_BOT_TOKEN" //nolint:gosec
	EnvDiscordBotPublicKey   = "DISCORD_BOT_PUBLIC_KEY"
	EnvDiscordBotWebhookPort = "DISCORD_BOT_WEBHOOK_PORT"

	EnvOpenAIAPISecret                       = "OPENAI_API_SECRET" //nolint:gosec
	EnvOpenAIAPIHost                         = "OPENAI_API_HOST"
	EnvOpenAIAPIModelName                    = "OPENAI_API_MODEL_NAME"
	EnvOpenAIAPITokenLimit                   = "OPENAI_API_TOKEN_LIMIT"                      //nolint:gosec
	EnvOpenAIAPIChatHistoriesRecapTokenLimit = "OPENAI_API_CHAT_HISTORIES_RECAP_TOKEN_LIMIT" //nolint:gosec

	EnvPineconeProjectName          = "PINECONE_PROJECT_NAME"
	EnvPineconeEnvironment          = "PINECONE_ENVIRONMENT"
	EnvPineconeAPIKey               = "PINECONE_API_KEY" //nolint:gosec
	EnvPineconeChatHistoryIndexName = "PINECONE_CHAT_HISTORY_INDEX_NAME"

	EnvDBConnectionString = "DB_CONNECTION_STR"

	EnvRedisHost               = "REDIS_HOST"
	EnvRedisPort               = "REDIS_PORT"
	EnvRedisTLSEnabled         = "REDIS_TLS_ENABLED"
	EnvRedisUsername           = "REDIS_USERNAME"
	EnvRedisPassword           = "REDIS_PASSWORD"
	EnvRedisDB                 = "REDIS_DB"
	EnvRedisClientCacheEnabled = "REDIS_CLIENT_CACHE_ENABLED"

	EnvLogLevel    = "LOG_LEVEL"
	EnvLogFilePath = "LOG_FILE_PATH"

	EnvHardLimitManualRecapRatePerSeconds      = "HARD_LIMIT_MANUAL_RECAP_RATE_PER_SECONDS"
	EnvHardLimitSummarizeWebpageRatePerSeconds = "HARD_LIMIT_SMR_WEBPAGE_RATE_PER_SECONDS"
)

Variables

This section is empty.

Functions

func NewConfig

func NewConfig() func() (*Config, error)

func NewTestConfig

func NewTestConfig() func() *Config

Types

type Config

type Config struct {
	TimezoneShiftSeconds int64
	Telegram             SectionTelegram
	OpenAI               SectionOpenAI
	Pinecone             SectionPinecone
	CloverDBPath         string
	DB                   SectionDB
	Slack                SectionSlack
	Discord              SectionDiscord
	Redis                SectionRedis
	LogLevel             string
	LogFilePath          string
	HardLimit            SectionHardLimit
}

type SectionDB

type SectionDB struct {
	ConnectionString string
}

type SectionDiscord

type SectionDiscord struct {
	Port      string
	Token     string
	PublicKey string
}

type SectionHardLimit added in v0.16.0

type SectionHardLimit struct {
	ManualRecapRatePerSeconds      int64
	SummarizeWebpageRatePerSeconds int64
}

type SectionOpenAI added in v0.18.0

type SectionOpenAI struct {
	Secret                       string
	Host                         string
	ModelName                    string
	TokenLimit                   int64
	ChatHistoriesRecapTokenLimit int64
}

type SectionPinecone

type SectionPinecone struct {
	ProjectName string
	Environment string
	APIKey      string

	Indexes SectionPineconeIndexes
}

type SectionPineconeIndexes

type SectionPineconeIndexes struct {
	ChatHistoryIndexName string
}

type SectionRedis

type SectionRedis struct {
	Host               string
	Port               string
	TLSEnabled         bool
	Username           string
	Password           string
	DB                 int64
	ClientCacheEnabled bool
}

type SectionSlack

type SectionSlack struct {
	Port         string
	ClientID     string
	ClientSecret string
}

type SectionTelegram

type SectionTelegram struct {
	BotToken       string
	BotWebhookURL  string
	BotWebhookPort string
	BotAPIEndpoint string
}

Jump to

Keyboard shortcuts

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