model_setting

package
v0.10.8-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGeminiSafetySetting

func GetGeminiSafetySetting(key string) string

GetGeminiSafetySetting 获取安全设置

func GetGeminiVersionSetting

func GetGeminiVersionSetting(key string) string

GetGeminiVersionSetting 获取版本设置

func IsGeminiModelSupportImagine

func IsGeminiModelSupportImagine(model string) bool

func IsSyncImageModel

func IsSyncImageModel(model string) bool

IsSyncImageModel

func ShouldPreserveThinkingSuffix

func ShouldPreserveThinkingSuffix(modelName string) bool

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 GetClaudeSettings

func GetClaudeSettings() *ClaudeSettings

GetClaudeSettings 获取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结尾才可以生效编辑

func GetGeminiSettings

func GetGeminiSettings() *GeminiSettings

GetGeminiSettings 获取Gemini配置

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结尾才可以生效编辑

func GetQwenSettings

func GetQwenSettings() *QwenSettings

GetQwenSettings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL