channel_settings.go 1.5 KB

123456789101112131415161718192021222324252627282930313233
  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 ChannelOtherSettings struct {
  16. AzureResponsesVersion string `json:"azure_responses_version,omitempty"`
  17. VertexKeyType VertexKeyType `json:"vertex_key_type,omitempty"` // "json" or "api_key"
  18. OpenRouterEnterprise *bool `json:"openrouter_enterprise,omitempty"`
  19. AllowServiceTier bool `json:"allow_service_tier,omitempty"` // 是否允许 service_tier 透传(默认过滤以避免额外计费)
  20. DisableStore bool `json:"disable_store,omitempty"` // 是否禁用 store 透传(默认允许透传,禁用后可能导致 Codex 无法使用)
  21. AllowSafetyIdentifier bool `json:"allow_safety_identifier,omitempty"` // 是否允许 safety_identifier 透传(默认过滤以保护用户隐私)
  22. }
  23. func (s *ChannelOtherSettings) IsOpenRouterEnterprise() bool {
  24. if s == nil || s.OpenRouterEnterprise == nil {
  25. return false
  26. }
  27. return *s.OpenRouterEnterprise
  28. }