mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 12:20:52 +08:00
feat(cliproxy): propagate thinking support metadata to aliased models
This commit is contained in:
@@ -781,3 +781,29 @@ func GetAntigravityModelConfig() map[string]*AntigravityModelConfig {
|
|||||||
"gemini-claude-opus-4-5-thinking": {Thinking: &ThinkingSupport{Min: 1024, Max: 200000, ZeroAllowed: false, DynamicAllowed: true}, MaxCompletionTokens: 64000},
|
"gemini-claude-opus-4-5-thinking": {Thinking: &ThinkingSupport{Min: 1024, Max: 200000, ZeroAllowed: false, DynamicAllowed: true}, MaxCompletionTokens: 64000},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LookupStaticModelInfo searches all static model definitions for a model by ID.
|
||||||
|
// Returns nil if no matching model is found.
|
||||||
|
func LookupStaticModelInfo(modelID string) *ModelInfo {
|
||||||
|
if modelID == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
allModels := [][]*ModelInfo{
|
||||||
|
GetClaudeModels(),
|
||||||
|
GetGeminiModels(),
|
||||||
|
GetGeminiVertexModels(),
|
||||||
|
GetGeminiCLIModels(),
|
||||||
|
GetAIStudioModels(),
|
||||||
|
GetOpenAIModels(),
|
||||||
|
GetQwenModels(),
|
||||||
|
GetIFlowModels(),
|
||||||
|
}
|
||||||
|
for _, models := range allModels {
|
||||||
|
for _, m := range models {
|
||||||
|
if m != nil && m.ID == modelID {
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -1150,14 +1150,20 @@ func buildConfigModels[T modelEntry](models []T, ownedBy, modelType string) []*M
|
|||||||
if display == "" {
|
if display == "" {
|
||||||
display = alias
|
display = alias
|
||||||
}
|
}
|
||||||
out = append(out, &ModelInfo{
|
info := &ModelInfo{
|
||||||
ID: alias,
|
ID: alias,
|
||||||
Object: "model",
|
Object: "model",
|
||||||
Created: now,
|
Created: now,
|
||||||
OwnedBy: ownedBy,
|
OwnedBy: ownedBy,
|
||||||
Type: modelType,
|
Type: modelType,
|
||||||
DisplayName: display,
|
DisplayName: display,
|
||||||
})
|
}
|
||||||
|
if name != "" {
|
||||||
|
if upstream := registry.LookupStaticModelInfo(name); upstream != nil && upstream.Thinking != nil {
|
||||||
|
info.Thinking = upstream.Thinking
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out = append(out, info)
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user