Documentation
¶
Index ¶
- func GetGeminiSafetySetting(key string) string
- func GetGeminiVersionSetting(key string) string
- func IsGeminiModelSupportImagine(model string) bool
- func IsSyncImageModel(model string) bool
- func ShouldPreserveThinkingSuffix(modelName string) bool
- type ChatCompletionsToResponsesPolicy
- type ClaudeSettings
- type GeminiSettings
- type GlobalSettings
- type GrokSettings
- type QwenSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGeminiSafetySetting ¶
GetGeminiSafetySetting 获取安全设置
func GetGeminiVersionSetting ¶
GetGeminiVersionSetting 获取版本设置
func ShouldPreserveThinkingSuffix ¶
ShouldPreserveThinkingSuffix 判断模型是否配置为保留 thinking/-nothinking/-low/-high/-medium 后缀
Types ¶
type ChatCompletionsToResponsesPolicy ¶
type ChatCompletionsToResponsesPolicy struct {
Enabled bool `json:"enabled"`
AllChannels bool `json:"all_channels"`
ChannelIDs []int `json:"channel_ids,omitempty"`
ChannelTypes []int `json:"channel_types,omitempty"`
ModelPatterns []string `json:"model_patterns,omitempty"`
}
func (ChatCompletionsToResponsesPolicy) IsChannelEnabled ¶
func (p ChatCompletionsToResponsesPolicy) IsChannelEnabled(channelID int, channelType int) bool
type ClaudeSettings ¶
type ClaudeSettings struct {
HeadersSettings map[string]map[string][]string `json:"model_headers_settings"`
DefaultMaxTokens map[string]int `json:"default_max_tokens"`
ThinkingAdapterEnabled bool `json:"thinking_adapter_enabled"`
ThinkingAdapterBudgetTokensPercentage float64 `json:"thinking_adapter_budget_tokens_percentage"`
}
ClaudeSettings 定义Claude模型的配置
func (*ClaudeSettings) GetDefaultMaxTokens ¶
func (c *ClaudeSettings) GetDefaultMaxTokens(model string) int
func (*ClaudeSettings) WriteHeaders ¶
func (c *ClaudeSettings) WriteHeaders(originModel string, httpHeader *http.Header)
type GeminiSettings ¶
type GeminiSettings struct {
SafetySettings map[string]string `json:"safety_settings"`
VersionSettings map[string]string `json:"version_settings"`
SupportedImagineModels []string `json:"supported_imagine_models"`
ThinkingAdapterEnabled bool `json:"thinking_adapter_enabled"`
ThinkingAdapterBudgetTokensPercentage float64 `json:"thinking_adapter_budget_tokens_percentage"`
FunctionCallThoughtSignatureEnabled bool `json:"function_call_thought_signature_enabled"`
RemoveFunctionResponseIdEnabled bool `json:"remove_function_response_id_enabled"`
}
GeminiSettings defines Gemini model configuration. 注意bool要以enabled结尾才可以生效编辑
type GlobalSettings ¶
type GlobalSettings struct {
PassThroughRequestEnabled bool `json:"pass_through_request_enabled"`
ThinkingModelBlacklist []string `json:"thinking_model_blacklist"`
ChatCompletionsToResponsesPolicy ChatCompletionsToResponsesPolicy `json:"chat_completions_to_responses_policy"`
}
func GetGlobalSettings ¶
func GetGlobalSettings() *GlobalSettings
type GrokSettings ¶
type GrokSettings struct {
ViolationDeductionEnabled bool `json:"violation_deduction_enabled"`
ViolationDeductionAmount float64 `json:"violation_deduction_amount"`
}
GrokSettings defines Grok model configuration.
func GetGrokSettings ¶
func GetGrokSettings() *GrokSettings
type QwenSettings ¶
type QwenSettings struct {
SyncImageModels []string `json:"sync_image_models"`
}
QwenSettings defines Qwen model configuration. 注意bool要以enabled结尾才可以生效编辑
Click to show internal directories.
Click to hide internal directories.