channel_settings.go 1.7 KB

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