Documentation
¶
Index ¶
- Variables
- func AutoGroups2JsonString() string
- func Chats2JsonString() string
- func CheckModelRequestRateLimitGroup(jsonStr string) error
- func ContainsAutoGroup(group string) bool
- func GetAutoGroups() []string
- func GetGroupRateLimit(group string) (totalCount, successCount int, found bool)
- func GetUsableGroupDescription(groupName string) string
- func GetUserUsableGroupsCopy() map[string]string
- func ModelRequestRateLimitGroup2JSONString() string
- func SensitiveWordsFromString(s string)
- func SensitiveWordsToString() string
- func ShouldCheckPromptSensitive() bool
- func UpdateAutoGroupsByJsonString(jsonString string) error
- func UpdateChatsByJsonString(jsonString string) error
- func UpdateModelRequestRateLimitGroupByJSONString(jsonStr string) error
- func UpdateUserUsableGroupsByJSONString(jsonStr string) error
- func UserUsableGroups2JSONString() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AlipayEnabled bool = getEnvBool("ALIPAY_ENABLED", true) AlipayAppId string = getEnvOrDefault("ALIPAY_APP_ID", "") AlipayPrivateKey string = "" // 优先使用文件路径 AlipayPrivateKeyPath string = getEnvOrDefault("ALIPAY_PRIVATE_KEY_PATH", "cert/alipay/private_key.pem") AlipayPublicKey string = "" // 优先使用文件路径 AlipayPublicKeyPath string = getEnvOrDefault("ALIPAY_PUBLIC_KEY_PATH", "cert/alipay/public_key.pem") AlipaySellerId string = getEnvOrDefault("ALIPAY_SELLER_ID", "your-alipay-seller-id") AlipaySandbox bool = getEnvBool("ALIPAY_SANDBOX", false) AlipayNotifyUrl string = getEnvOrDefault("ALIPAY_NOTIFY_URL", "") AlipayUnitPrice float64 = getEnvFloat("ALIPAY_UNIT_PRICE", 1.0) AlipayMinTopUp int = getEnvInt("ALIPAY_MIN_TOPUP", 1) )
View Source
var ( WechatEnabled bool = getEnvBool("WECHAT_ENABLED", true) WechatPublicKeyID string = getEnvOrDefault("WECHAT_PUBLIC_KEY_ID", "") WechatPublicKey string = getEnvOrDefault("WECHAT_PUBLIC_KEY", "") WechatPublicKeyPath string = getEnvOrDefault("WECHAT_PUBLIC_KEY_PATH", "cert/wechat/pub_key.pem") WechatAppId string = getEnvOrDefault("WECHAT_APP_ID", "") WechatMchId string = getEnvOrDefault("WECHAT_MCH_ID", "") WechatMchName string = getEnvOrDefault("WECHAT_MCH_NAME", "FastToken") WechatApiV3Key string = getEnvOrDefault("WECHAT_API_V3_KEY", "") WechatPrivateKey string = "" // 优先使用文件路径 WechatPrivateKeyPath string = getEnvOrDefault("WECHAT_PRIVATE_KEY_PATH", "cert/wechat/apiclient_key.pem") WechatPlatformCertPath string = getEnvOrDefault("WECHAT_PLATFORM_CERT_PATH", "cert/wechat/微信平台公钥.pem") WechatSerialNo string = getEnvOrDefault("WECHAT_SERIAL_NO", "") WechatNotifyUrl string = getEnvOrDefault("WECHAT_NOTIFY_URL", "") WechatUnitPrice float64 = 1.0 WechatMinTopUp int = 1 )
View Source
var Chats = []map[string]string{
{
"Cherry Studio": "cherrystudio://providers/api-keys?v=1&data={cherryConfig}",
},
{
"AionUI": "aionui://provider/add?v=1&data={aionuiConfig}",
},
{
"流畅阅读": "fluentread",
},
{
"CC Switch": "ccswitch",
},
{
"DeepChat": "deepchat://provider/install?v=1&data={deepchatConfig}",
},
{
"Lobe Chat 官方示例": "https://chat-preview.lobehub.com/?settings={\"keyVaults\":{\"openai\":{\"apiKey\":\"{key}\",\"baseURL\":\"{address}/v1\"}}}",
},
{
"AI as Workspace": "https://aiaw.app/set-provider?provider={\"type\":\"openai\",\"settings\":{\"apiKey\":\"{key}\",\"baseURL\":\"{address}/v1\",\"compatibility\":\"strict\"}}",
},
{
"AMA 问天": "ama://set-api-key?server={address}&key={key}",
},
{
"OpenCat": "opencat://team/join?domain={address}&token={key}",
},
}
View Source
var CheckSensitiveEnabled = true
View Source
var CheckSensitiveOnPromptEnabled = true
View Source
var DefaultUseAutoGroup = false
View Source
var MjAccountFilterEnabled = false
View Source
var MjActionCheckSuccessEnabled = true
View Source
var MjForwardUrlEnabled = true
View Source
var MjModeClearEnabled = false
View Source
var MjNotifyEnabled = false
View Source
var ModelRequestRateLimitCount = 0
View Source
var ModelRequestRateLimitDurationMinutes = 1
View Source
var ModelRequestRateLimitEnabled = false
View Source
var ModelRequestRateLimitGroup = map[string][2]int{}
View Source
var ModelRequestRateLimitMutex sync.RWMutex
View Source
var ModelRequestRateLimitSuccessCount = 1000
View Source
var SensitiveWords = []string{
"test_sensitive",
}
SensitiveWords 敏感词 var SensitiveWords []string
View Source
var StopOnSensitiveEnabled = true
StopOnSensitiveEnabled 如果检测到敏感词,是否立刻停止生成,否则替换敏感词
View Source
var StreamCacheQueueLength = 0
StreamCacheQueueLength 流模式缓存队列长度,0表示无缓存
Functions ¶
func AutoGroups2JsonString ¶
func AutoGroups2JsonString() string
func Chats2JsonString ¶
func Chats2JsonString() string
func ContainsAutoGroup ¶
func GetAutoGroups ¶
func GetAutoGroups() []string
func GetGroupRateLimit ¶
func GetUserUsableGroupsCopy ¶
func ModelRequestRateLimitGroup2JSONString ¶
func ModelRequestRateLimitGroup2JSONString() string
func SensitiveWordsFromString ¶
func SensitiveWordsFromString(s string)
func SensitiveWordsToString ¶
func SensitiveWordsToString() string
func ShouldCheckPromptSensitive ¶
func ShouldCheckPromptSensitive() bool
func UpdateChatsByJsonString ¶
func UserUsableGroups2JSONString ¶
func UserUsableGroups2JSONString() string
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.