2024-12-22 17:24:29 +08:00
|
|
|
package constant
|
2024-12-23 20:48:10 +08:00
|
|
|
|
2025-07-03 13:10:25 +08:00
|
|
|
type ContextKey string
|
|
|
|
|
|
2024-12-23 20:48:10 +08:00
|
|
|
const (
|
2025-12-02 21:34:39 +08:00
|
|
|
ContextKeyTokenCountMeta ContextKey = "token_count_meta"
|
|
|
|
|
ContextKeyPromptTokens ContextKey = "prompt_tokens"
|
|
|
|
|
ContextKeyEstimatedTokens ContextKey = "estimated_tokens"
|
2025-08-14 20:05:06 +08:00
|
|
|
|
2025-07-03 13:10:25 +08:00
|
|
|
ContextKeyOriginalModel ContextKey = "original_model"
|
|
|
|
|
ContextKeyRequestStartTime ContextKey = "request_start_time"
|
|
|
|
|
|
|
|
|
|
/* token related keys */
|
|
|
|
|
ContextKeyTokenUnlimited ContextKey = "token_unlimited_quota"
|
|
|
|
|
ContextKeyTokenKey ContextKey = "token_key"
|
|
|
|
|
ContextKeyTokenId ContextKey = "token_id"
|
|
|
|
|
ContextKeyTokenGroup ContextKey = "token_group"
|
|
|
|
|
ContextKeyTokenSpecificChannelId ContextKey = "specific_channel_id"
|
|
|
|
|
ContextKeyTokenModelLimitEnabled ContextKey = "token_model_limit_enabled"
|
|
|
|
|
ContextKeyTokenModelLimit ContextKey = "token_model_limit"
|
2025-12-12 17:59:21 +08:00
|
|
|
ContextKeyTokenCrossGroupRetry ContextKey = "token_cross_group_retry"
|
2025-07-03 13:10:25 +08:00
|
|
|
|
|
|
|
|
/* channel related keys */
|
2025-07-06 12:37:56 +08:00
|
|
|
ContextKeyChannelId ContextKey = "channel_id"
|
|
|
|
|
ContextKeyChannelName ContextKey = "channel_name"
|
2025-07-12 15:14:55 +08:00
|
|
|
ContextKeyChannelCreateTime ContextKey = "channel_create_time"
|
2025-07-06 12:37:56 +08:00
|
|
|
ContextKeyChannelBaseUrl ContextKey = "base_url"
|
|
|
|
|
ContextKeyChannelType ContextKey = "channel_type"
|
|
|
|
|
ContextKeyChannelSetting ContextKey = "channel_setting"
|
2025-08-10 20:21:30 +08:00
|
|
|
ContextKeyChannelOtherSetting ContextKey = "channel_other_setting"
|
2025-07-06 12:37:56 +08:00
|
|
|
ContextKeyChannelParamOverride ContextKey = "param_override"
|
2025-08-24 01:02:23 +08:00
|
|
|
ContextKeyChannelHeaderOverride ContextKey = "header_override"
|
2025-07-06 12:37:56 +08:00
|
|
|
ContextKeyChannelOrganization ContextKey = "channel_organization"
|
|
|
|
|
ContextKeyChannelAutoBan ContextKey = "auto_ban"
|
|
|
|
|
ContextKeyChannelModelMapping ContextKey = "model_mapping"
|
|
|
|
|
ContextKeyChannelStatusCodeMapping ContextKey = "status_code_mapping"
|
|
|
|
|
ContextKeyChannelIsMultiKey ContextKey = "channel_is_multi_key"
|
2025-07-12 15:14:55 +08:00
|
|
|
ContextKeyChannelMultiKeyIndex ContextKey = "channel_multi_key_index"
|
2025-07-10 17:49:53 +08:00
|
|
|
ContextKeyChannelKey ContextKey = "channel_key"
|
2025-07-03 13:10:25 +08:00
|
|
|
|
2025-12-13 16:43:38 +08:00
|
|
|
ContextKeyAutoGroup ContextKey = "auto_group"
|
|
|
|
|
ContextKeyAutoGroupIndex ContextKey = "auto_group_index"
|
|
|
|
|
ContextKeyAutoGroupRetryIndex ContextKey = "auto_group_retry_index"
|
|
|
|
|
|
2025-07-03 13:10:25 +08:00
|
|
|
/* user related keys */
|
|
|
|
|
ContextKeyUserId ContextKey = "id"
|
|
|
|
|
ContextKeyUserSetting ContextKey = "user_setting"
|
|
|
|
|
ContextKeyUserQuota ContextKey = "user_quota"
|
|
|
|
|
ContextKeyUserStatus ContextKey = "user_status"
|
|
|
|
|
ContextKeyUserEmail ContextKey = "user_email"
|
|
|
|
|
ContextKeyUserGroup ContextKey = "user_group"
|
|
|
|
|
ContextKeyUsingGroup ContextKey = "group"
|
|
|
|
|
ContextKeyUserName ContextKey = "username"
|
2025-08-09 12:53:06 +08:00
|
|
|
|
2025-11-21 18:16:40 +08:00
|
|
|
ContextKeyLocalCountTokens ContextKey = "local_count_tokens"
|
|
|
|
|
|
2025-08-09 12:53:06 +08:00
|
|
|
ContextKeySystemPromptOverride ContextKey = "system_prompt_override"
|
2026-01-25 14:52:18 +08:00
|
|
|
|
2026-02-04 17:15:24 +08:00
|
|
|
// ContextKeyFileSourcesToCleanup stores file sources that need cleanup when request ends
|
|
|
|
|
ContextKeyFileSourcesToCleanup ContextKey = "file_sources_to_cleanup"
|
|
|
|
|
|
2026-01-25 14:52:18 +08:00
|
|
|
// ContextKeyAdminRejectReason stores an admin-only reject/block reason extracted from upstream responses.
|
|
|
|
|
// It is not returned to end users, but can be persisted into consume/error logs for debugging.
|
|
|
|
|
ContextKeyAdminRejectReason ContextKey = "admin_reject_reason"
|
2026-02-05 00:07:54 +08:00
|
|
|
|
|
|
|
|
// ContextKeyLanguage stores the user's language preference for i18n
|
|
|
|
|
ContextKeyLanguage ContextKey = "language"
|
2026-04-12 17:41:26 +08:00
|
|
|
ContextKeyIsStream ContextKey = "is_stream"
|
2024-12-23 20:48:10 +08:00
|
|
|
)
|