Publish Docker image (Multi-arch) / Build & push (amd64) (push) Failing after 1m40s
Release (Linux, macOS, Windows) / Linux Release (push) Failing after 42m16s
Publish Docker image (Multi-arch) / Build & push (arm64) (push) Canceled after 0s
Release (Linux, macOS, Windows) / macOS Release (push) Canceled after 0s
Release (Linux, macOS, Windows) / Windows Release (push) Canceled after 0s
Publish Docker image (Multi-arch) / Create multi-arch manifests (push) Canceled after 0s
Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
88 lines
4.4 KiB
Go
88 lines
4.4 KiB
Go
package constant
|
|
|
|
type ContextKey string
|
|
|
|
const (
|
|
ContextKeyTokenCountMeta ContextKey = "token_count_meta"
|
|
ContextKeyPromptTokens ContextKey = "prompt_tokens"
|
|
ContextKeyEstimatedTokens ContextKey = "estimated_tokens"
|
|
|
|
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"
|
|
ContextKeyOriginTasks ContextKey = "origin_tasks"
|
|
ContextKeyChannelConstraints ContextKey = "channel_constraints"
|
|
ContextKeyTokenModelLimitEnabled ContextKey = "token_model_limit_enabled"
|
|
ContextKeyTokenModelLimit ContextKey = "token_model_limit"
|
|
ContextKeyTokenCrossGroupRetry ContextKey = "token_cross_group_retry"
|
|
ContextKeyTokenAstraDetectionDisabled ContextKey = "token_astra_detection_disabled"
|
|
ContextKeyTokenAstraAutoSwitch ContextKey = "token_astra_auto_switch"
|
|
ContextKeyTokenAutoGroups ContextKey = "token_auto_groups"
|
|
ContextKeyTokenGroupPool ContextKey = "token_group_pool"
|
|
ContextKeyTokenFailedGroups ContextKey = "token_failed_groups"
|
|
|
|
/* channel related keys */
|
|
ContextKeyChannelId ContextKey = "channel_id"
|
|
ContextKeyChannelName ContextKey = "channel_name"
|
|
ContextKeyChannelCreateTime ContextKey = "channel_create_time"
|
|
ContextKeyChannelBaseUrl ContextKey = "base_url"
|
|
ContextKeyChannelType ContextKey = "channel_type"
|
|
ContextKeyChannelSetting ContextKey = "channel_setting"
|
|
ContextKeyChannelOtherSetting ContextKey = "channel_other_setting"
|
|
ContextKeyChannelParamOverride ContextKey = "param_override"
|
|
ContextKeyChannelHeaderOverride ContextKey = "header_override"
|
|
ContextKeyChannelOrganization ContextKey = "channel_organization"
|
|
ContextKeyChannelAutoBan ContextKey = "auto_ban"
|
|
ContextKeyChannelModelMapping ContextKey = "model_mapping"
|
|
ContextKeyChannelStatusCodeMapping ContextKey = "status_code_mapping"
|
|
ContextKeyChannelIsMultiKey ContextKey = "channel_is_multi_key"
|
|
ContextKeyChannelMultiKeyIndex ContextKey = "channel_multi_key_index"
|
|
ContextKeyChannelKey ContextKey = "channel_key"
|
|
|
|
ContextKeyAutoGroup ContextKey = "auto_group"
|
|
ContextKeyAutoGroupIndex ContextKey = "auto_group_index"
|
|
ContextKeyAutoGroupRetryIndex ContextKey = "auto_group_retry_index"
|
|
|
|
/* 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"
|
|
|
|
ContextKeyLocalCountTokens ContextKey = "local_count_tokens"
|
|
|
|
ContextKeySystemPromptOverride ContextKey = "system_prompt_override"
|
|
|
|
// ContextKeyFileSourcesToCleanup stores file sources that need cleanup when request ends
|
|
ContextKeyFileSourcesToCleanup ContextKey = "file_sources_to_cleanup"
|
|
|
|
// 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"
|
|
|
|
// ContextKeyLanguage stores the user's language preference for i18n
|
|
ContextKeyLanguage ContextKey = "language"
|
|
ContextKeyIsStream ContextKey = "is_stream"
|
|
ContextKeyResponseStreamStatus ContextKey = "response_stream_status"
|
|
|
|
// ContextKeyAuditLogged marks that the current request has already recorded
|
|
// a manage/operation audit log inside the handler. When set, the admin-audit
|
|
// fallback in authHelper (finishAdminAudit) skips its record to avoid
|
|
// duplicate entries.
|
|
ContextKeyAuditLogged ContextKey = "audit_logged"
|
|
|
|
// ContextKeyTokenAuditParams contains only the API token operation's safe metadata.
|
|
ContextKeyTokenAuditParams ContextKey = "token_audit_params"
|
|
// ContextKeyTokenAuditSucceeded disambiguates token responses that exceed the audit buffer.
|
|
ContextKeyTokenAuditSucceeded ContextKey = "token_audit_succeeded"
|
|
)
|