settings

package
v0.0.0-...-5a88d1b Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "Morrigan"
)

consts

Variables

View Source
var (
	// Current 当前配置
	Current = new(Config)
)

Functions

func AllowAllOrigins

func AllowAllOrigins() bool

AllowAllOrigins ...

func InDevelop

func InDevelop() bool

func Usage

func Usage() error

Usage 打印配置帮助

func Version

func Version() string

Types

type Config

type Config struct {
	Name         string   `ignored:"true"`
	Version      string   `ignored:"true"`
	PgStoreDSN   string   `envconfig:"PG_STORE_DSN" default:"postgres://morrigan@localhost/morrigan?sslmode=disable"`
	PgTSConfig   string   `envconfig:"PG_TS_CONFIG"`
	PgQueryDebug bool     `envconfig:"PG_QUERY_DEBUG"`
	DbAutoInit   bool     `envconfig:"DB_AUTO_INIT"`
	SentryDSN    string   `envconfig:"SENTRY_DSN" `
	HTTPListen   string   `envconfig:"HTTP_LISTEN" default:":5001" required:"true"`
	RedisURI     string   `envconfig:"redis_uri" default:"redis://localhost:6379/1" required:"true"`
	AllowOrigins []string `envconfig:"allow_origins" default:"*" desc:"cors"` // CORS: 允许的 Origin 调用来源
	AuthRequired bool     `envconfig:"Auth_Required"`
	AuthSecret   string   `envconfig:"Auth_Secret" desc:"for chatgpt-web session only"`
	CookieName   string   `envconfig:"Cookie_Name" default:"oaic" desc:"for oauth client"`
	CookiePath   string   `envconfig:"Cookie_Path" default:"/" desc:"for oauth client"`
	CookieDomain string   `envconfig:"Cookie_Domain" desc:"for oauth client"`
	CookieMaxAge int      `envconfig:"Cookie_MaxAge" desc:"for oauth client"`

	OpenAIAPIKey string `envconfig:"openAi_Api_Key" required:"true"`
	ChatModel    string `envconfig:"CHAT_MODEL"  required:"true" default:"gpt-3.5-turbo"`
	PresetFile   string `envconfig:"preset_file" desc:"custom welcome and messages"`
	QAEmbedding  bool   `envconfig:"QA_Embedding" desc:"enable embed QA into prompt"`
	QAChatLog    bool   `envconfig:"QA_chat_log"`
	QAFallback   bool   `envconfig:"QA_Fallback"`

	AskRateLimit string `envconfig:"Ask_Rate_Limit" default:"30-H"`
}

Config ...

Jump to

Keyboard shortcuts

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