Documentation ¶
Index ¶
Constants ¶
View Source
const ( ACTION_CREATE = "create" ACTION_UPDATE = "update" ACTION_DELETE = "delete" ACTION_STATUS = "status" ACTION_MODELS = "models" )
View Source
const ( SESSION_USER = "session_user" SESSION_APP = "session_app" SESSION_KEY = "session_key" SESSION_ERROR_MODEL_AGENTS = "session_error_model_agents" SESSION_ERROR_KEYS = "session_error_keys" HOST_KEY = "host" USER_ID_KEY = "user_id" APP_ID_KEY = "app_id" SECRET_KEY = "sk" APP_IS_LIMIT_QUOTA_KEY = "app_is_limit_quota" KEY_IS_LIMIT_QUOTA_KEY = "key_is_limit_quota" CORP_OPENAI = "OpenAI" CORP_AZURE = "Azure" CORP_BAIDU = "Baidu" CORP_XFYUN = "Xfyun" CORP_ALIYUN = "Aliyun" CORP_ZHIPUAI = "ZhipuAI" CORP_GOOGLE = "Google" CORP_DEEPSEEK = "DeepSeek" CORP_MIDJOURNEY = "Midjourney" CORP_GCP_CLAUDE = "GCPClaude" ROLE_SYSTEM = "system" ROLE_USER = "user" ROLE_ASSISTANT = "assistant" ROLE_FUNCTION = "function" ROLE_TOOL = "tool" GPT_PREFIX = "gpt-" DEFAULT_MODEL = "gpt-3.5-turbo" QUOTA_USD_UNIT = 500000.0 // $1 = 50万tokens )
View Source
const ( API_USAGE_KEY = "api:user:%d:usage" USER_QUOTA_FIELD = "user.quota" APP_QUOTA_FIELD = "app.%d.quota" KEY_QUOTA_FIELD = "key.%d.%s.quota" API_USER_KEY = "api:user:%d" API_APP_KEY = "api:app:%d" API_APP_KEY_KEY = "api:app:key:%s" API_CORPS_KEY = "api:corps" API_MODELS_KEY = "api:models" API_MODEL_KEYS_KEY = "api:model:keys:%s" API_MODEL_AGENTS_KEY = "api:model_agents" API_MODEL_AGENT_KEYS_KEY = "api:model_agent:keys:%s" ERROR_MODEL_KEY = "api:error:model:key:%s" ERROR_MODEL_AGENT = "api:error:model:agent:%s" ERROR_MODEL_AGENT_KEY = "api:error:model:agent:key:%s" ACCESS_TOKEN_KEY = "api:baidu:access_token:%s" GCP_TOKEN_KEY = "api:gcp:token:%s" )
View Source
const ( LOCK_USER_KEY = "api:lock:user:%d" LOCK_APP_KEY = "api:lock:app:%d" LOCK_SK_KEY = "api:lock:sk:%s" )
Variables ¶
View Source
var ( CHANGE_CHANNEL_USER = config.Cfg.Core.ChannelPrefix + "admin:change:channel:user" CHANGE_CHANNEL_APP = config.Cfg.Core.ChannelPrefix + "admin:change:channel:app" CHANGE_CHANNEL_APP_KEY = config.Cfg.Core.ChannelPrefix + "admin:change:channel:app:key" CHANGE_CHANNEL_CORP = config.Cfg.Core.ChannelPrefix + "admin:change:channel:corp" CHANGE_CHANNEL_MODEL = config.Cfg.Core.ChannelPrefix + "admin:change:channel:model" CHANGE_CHANNEL_KEY = config.Cfg.Core.ChannelPrefix + "admin:change:channel:key" CHANGE_CHANNEL_AGENT = config.Cfg.Core.ChannelPrefix + "admin:change:channel:agent" )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.