config

package
v0.0.0-...-bfbff3f Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OptionMap        map[string]string
	OptionMapRWMutex sync.RWMutex
)
View Source
var (
	DebugEnabled, _    = strconv.ParseBool(os.Getenv("DEBUG"))
	DebugSQLEnabled, _ = strconv.ParseBool(os.Getenv("DEBUG_SQL"))
)
View Source
var (
	// 代理地址
	RelayProxy = env.String("RELAY_PROXY", "")
	// 用户内容请求代理地址
	UserContentRequestProxy = env.String("USER_CONTENT_REQUEST_PROXY", "")
	// 用户内容请求超时时间,单位为秒
	UserContentRequestTimeout = env.Int("USER_CONTENT_REQUEST_TIMEOUT", 30)
)
View Source
var AdminKey = env.String("ADMIN_KEY", "")
View Source
var DisableAutoMigrateDB = os.Getenv("DISABLE_AUTO_MIGRATE_DB") == "true"
View Source
var OnlyOneLogFile = env.Bool("ONLY_ONE_LOG_FILE", false)
View Source
var RateLimitKeyExpirationDuration = 20 * time.Minute
View Source
var RelayTimeout = env.Int("RELAY_TIMEOUT", 0) // unit is second

Functions

func GetApproximateTokenEnabled

func GetApproximateTokenEnabled() bool

func GetAutomaticDisableChannelEnabled

func GetAutomaticDisableChannelEnabled() bool

func GetAutomaticEnableChannelWhenTestSucceedEnabled

func GetAutomaticEnableChannelWhenTestSucceedEnabled() bool

func GetBillingEnabled

func GetBillingEnabled() bool

func GetDefaultChannelModelMapping

func GetDefaultChannelModelMapping() map[int]map[string]string

func GetDefaultChannelModels

func GetDefaultChannelModels() map[int][]string

func GetDefaultGroupQPM

func GetDefaultGroupQPM() int64

group默认qpm,如果group没有设置qpm,则使用该qpm

func GetDisableServe

func GetDisableServe() bool

func GetGeminiSafetySetting

func GetGeminiSafetySetting() string

func GetGeminiVersion

func GetGeminiVersion() string

func GetGlobalAPIRateLimitNum

func GetGlobalAPIRateLimitNum() int64

全局qpm,不是根据ip限制,而是所有请求共享一个qpm

func GetGroupMaxTokenNum

func GetGroupMaxTokenNum() int32

那个group最多可创建的token数量,0表示不限制

func GetLogDetailStorageHours

func GetLogDetailStorageHours() int64

func GetRetryTimes

func GetRetryTimes() int64

func SetApproximateTokenEnabled

func SetApproximateTokenEnabled(enabled bool)

func SetAutomaticDisableChannelEnabled

func SetAutomaticDisableChannelEnabled(enabled bool)

func SetAutomaticEnableChannelWhenTestSucceedEnabled

func SetAutomaticEnableChannelWhenTestSucceedEnabled(enabled bool)

func SetBillingEnabled

func SetBillingEnabled(enabled bool)

func SetDefaultChannelModelMapping

func SetDefaultChannelModelMapping(mapping map[int]map[string]string)

func SetDefaultChannelModels

func SetDefaultChannelModels(models map[int][]string)

func SetDefaultGroupQPM

func SetDefaultGroupQPM(qpm int64)

func SetDisableServe

func SetDisableServe(disabled bool)

func SetGeminiSafetySetting

func SetGeminiSafetySetting(setting string)

func SetGeminiVersion

func SetGeminiVersion(version string)

func SetGlobalAPIRateLimitNum

func SetGlobalAPIRateLimitNum(num int64)

func SetGroupMaxTokenNum

func SetGroupMaxTokenNum(num int32)

func SetLogDetailStorageHours

func SetLogDetailStorageHours(hours int64)

func SetRetryTimes

func SetRetryTimes(times int64)

Types

This section is empty.

Jump to

Keyboard shortcuts

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