channel_settings.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. DisableStore bool `json:"disable_store,omitempty"` // 是否禁用 store 透传(默认允许透传,禁用后可能导致 Codex 无法使用)
  27. AllowSafetyIdentifier bool `json:"allow_safety_identifier,omitempty"` // 是否允许 safety_identifier 透传(默认过滤以保护用户隐私)
  28. AwsKeyType AwsKeyType `json:"aws_key_type,omitempty"`
  29. }
  30. func (s *ChannelOtherSettings) IsOpenRouterEnterprise() bool {
  31. if s == nil || s.OpenRouterEnterprise == nil {
  32. return false
  33. }
  34. return *s.OpenRouterEnterprise
  35. }