channel_settings.go 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package dto
  2. type ChannelSettings struct {
  3. ForceFormat bool `json:"force_format,omitempty"`
  4. ThinkingToContent bool `json:"thinking_to_content,omitempty"`
  5. Proxy string `json:"proxy"`
  6. PassThroughBodyEnabled bool `json:"pass_through_body_enabled,omitempty"`
  7. SystemPrompt string `json:"system_prompt,omitempty"`
  8. SystemPromptOverride bool `json:"system_prompt_override,omitempty"`
  9. }
  10. type VertexKeyType string
  11. const (
  12. VertexKeyTypeJSON VertexKeyType = "json"
  13. VertexKeyTypeAPIKey VertexKeyType = "api_key"
  14. )
  15. type AwsKeyType string
  16. const (
  17. AwsKeyTypeAKSK AwsKeyType = "ak_sk" // 默认
  18. AwsKeyTypeApiKey AwsKeyType = "api_key"
  19. )
  20. type ChannelOtherSettings struct {
  21. AzureResponsesVersion string `json:"azure_responses_version,omitempty"`
  22. VertexKeyType VertexKeyType `json:"vertex_key_type,omitempty"` // "json" or "api_key"
  23. OpenRouterEnterprise *bool `json:"openrouter_enterprise,omitempty"`
  24. ClaudeBetaQuery bool `json:"claude_beta_query,omitempty"` // Claude 渠道是否强制追加 ?beta=true
  25. AllowServiceTier bool `json:"allow_service_tier,omitempty"` // 是否允许 service_tier 透传(默认过滤以避免额外计费)
  26. AllowInferenceGeo bool `json:"allow_inference_geo,omitempty"` // 是否允许 inference_geo 透传(仅 Claude,默认过滤以满足数据驻留合规
  27. AllowSafetyIdentifier bool `json:"allow_safety_identifier,omitempty"` // 是否允许 safety_identifier 透传(默认过滤以保护用户隐私)
  28. DisableStore bool `json:"disable_store,omitempty"` // 是否禁用 store 透传(默认允许透传,禁用后可能导致 Codex 无法使用)
  29. AllowIncludeObfuscation bool `json:"allow_include_obfuscation,omitempty"` // 是否允许 stream_options.include_obfuscation 透传(默认过滤以避免关闭流混淆保护)
  30. AwsKeyType AwsKeyType `json:"aws_key_type,omitempty"`
  31. UpstreamModelUpdateCheckEnabled bool `json:"upstream_model_update_check_enabled,omitempty"` // 是否检测上游模型更新
  32. UpstreamModelUpdateAutoSyncEnabled bool `json:"upstream_model_update_auto_sync_enabled,omitempty"` // 是否自动同步上游模型更新
  33. UpstreamModelUpdateLastCheckTime int64 `json:"upstream_model_update_last_check_time,omitempty"` // 上次检测时间
  34. UpstreamModelUpdateLastDetectedModels []string `json:"upstream_model_update_last_detected_models,omitempty"` // 上次检测到的可加入模型
  35. UpstreamModelUpdateLastRemovedModels []string `json:"upstream_model_update_last_removed_models,omitempty"` // 上次检测到的可删除模型
  36. UpstreamModelUpdateIgnoredModels []string `json:"upstream_model_update_ignored_models,omitempty"` // 手动忽略的模型
  37. }
  38. func (s *ChannelOtherSettings) IsOpenRouterEnterprise() bool {
  39. if s == nil || s.OpenRouterEnterprise == nil {
  40. return false
  41. }
  42. return *s.OpenRouterEnterprise
  43. }