| package model_setting |
|
|
| import ( |
| "strings" |
|
|
| "github.com/QuantumNous/new-api/setting/config" |
| ) |
|
|
| type GlobalSettings struct { |
| PassThroughRequestEnabled bool `json:"pass_through_request_enabled"` |
| ThinkingModelBlacklist []string `json:"thinking_model_blacklist"` |
| } |
|
|
| |
| var defaultOpenaiSettings = GlobalSettings{ |
| PassThroughRequestEnabled: false, |
| ThinkingModelBlacklist: []string{ |
| "moonshotai/kimi-k2-thinking", |
| "kimi-k2-thinking", |
| }, |
| } |
|
|
| |
| var globalSettings = defaultOpenaiSettings |
|
|
| func init() { |
| |
| config.GlobalConfig.Register("global", &globalSettings) |
| } |
|
|
| func GetGlobalSettings() *GlobalSettings { |
| return &globalSettings |
| } |
|
|
| |
| func ShouldPreserveThinkingSuffix(modelName string) bool { |
| target := strings.TrimSpace(modelName) |
| if target == "" { |
| return false |
| } |
|
|
| for _, entry := range globalSettings.ThinkingModelBlacklist { |
| if strings.TrimSpace(entry) == target { |
| return true |
| } |
| } |
| return false |
| } |
|
|