You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

70 lines
3.3 KiB

  1. package constant
  2. type ContextKey string
  3. const (
  4. ContextKeyTokenCountMeta ContextKey = "token_count_meta"
  5. ContextKeyPromptTokens ContextKey = "prompt_tokens"
  6. ContextKeyEstimatedTokens ContextKey = "estimated_tokens"
  7. ContextKeyOriginalModel ContextKey = "original_model"
  8. ContextKeyRequestStartTime ContextKey = "request_start_time"
  9. /* token related keys */
  10. ContextKeyTokenUnlimited ContextKey = "token_unlimited_quota"
  11. ContextKeyTokenKey ContextKey = "token_key"
  12. ContextKeyTokenId ContextKey = "token_id"
  13. ContextKeyTokenGroup ContextKey = "token_group"
  14. ContextKeyTokenSpecificChannelId ContextKey = "specific_channel_id"
  15. ContextKeyTokenModelLimitEnabled ContextKey = "token_model_limit_enabled"
  16. ContextKeyTokenModelLimit ContextKey = "token_model_limit"
  17. ContextKeyTokenCrossGroupRetry ContextKey = "token_cross_group_retry"
  18. ContextKeyTokenBoundChannelId ContextKey = "token_bound_channel_id"
  19. /* channel related keys */
  20. ContextKeyChannelId ContextKey = "channel_id"
  21. ContextKeyChannelName ContextKey = "channel_name"
  22. ContextKeyChannelCreateTime ContextKey = "channel_create_time"
  23. ContextKeyChannelBaseUrl ContextKey = "base_url"
  24. ContextKeyChannelType ContextKey = "channel_type"
  25. ContextKeyChannelSetting ContextKey = "channel_setting"
  26. ContextKeyChannelOtherSetting ContextKey = "channel_other_setting"
  27. ContextKeyChannelParamOverride ContextKey = "param_override"
  28. ContextKeyChannelHeaderOverride ContextKey = "header_override"
  29. ContextKeyChannelOrganization ContextKey = "channel_organization"
  30. ContextKeyChannelAutoBan ContextKey = "auto_ban"
  31. ContextKeyChannelModelMapping ContextKey = "model_mapping"
  32. ContextKeyChannelStatusCodeMapping ContextKey = "status_code_mapping"
  33. ContextKeyChannelIsMultiKey ContextKey = "channel_is_multi_key"
  34. ContextKeyChannelMultiKeyIndex ContextKey = "channel_multi_key_index"
  35. ContextKeyChannelKey ContextKey = "channel_key"
  36. ContextKeyAutoGroup ContextKey = "auto_group"
  37. ContextKeyAutoGroupIndex ContextKey = "auto_group_index"
  38. ContextKeyAutoGroupRetryIndex ContextKey = "auto_group_retry_index"
  39. /* user related keys */
  40. ContextKeyUserId ContextKey = "id"
  41. ContextKeyUserSetting ContextKey = "user_setting"
  42. ContextKeyUserQuota ContextKey = "user_quota"
  43. ContextKeyUserStatus ContextKey = "user_status"
  44. ContextKeyUserEmail ContextKey = "user_email"
  45. ContextKeyUserGroup ContextKey = "user_group"
  46. ContextKeyUsingGroup ContextKey = "group"
  47. ContextKeyUserName ContextKey = "username"
  48. ContextKeyLocalCountTokens ContextKey = "local_count_tokens"
  49. ContextKeySystemPromptOverride ContextKey = "system_prompt_override"
  50. // ContextKeyFileSourcesToCleanup stores file sources that need cleanup when request ends
  51. ContextKeyFileSourcesToCleanup ContextKey = "file_sources_to_cleanup"
  52. // ContextKeyAdminRejectReason stores an admin-only reject/block reason extracted from upstream responses.
  53. // It is not returned to end users, but can be persisted into consume/error logs for debugging.
  54. ContextKeyAdminRejectReason ContextKey = "admin_reject_reason"
  55. // ContextKeyLanguage stores the user's language preference for i18n
  56. ContextKeyLanguage ContextKey = "language"
  57. )