mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 04:10:51 +08:00
feat(registry): add explicit thinking support config for antigravity models
This commit is contained in:
@@ -943,8 +943,19 @@ func GetQwenModels() []*ModelInfo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIFlowModels returns supported models for iFlow OAuth accounts.
|
// GetAntigravityThinkingConfig returns the Thinking configuration for antigravity models.
|
||||||
|
// Keys use the ALIASED model names (after modelName2Alias conversion) for direct lookup.
|
||||||
|
func GetAntigravityThinkingConfig() map[string]*ThinkingSupport {
|
||||||
|
return map[string]*ThinkingSupport{
|
||||||
|
"gemini-2.5-flash": {Min: 0, Max: 24576, ZeroAllowed: true, DynamicAllowed: true},
|
||||||
|
"gemini-2.5-flash-lite": {Min: 0, Max: 24576, ZeroAllowed: true, DynamicAllowed: true},
|
||||||
|
"gemini-3-pro-preview": {Min: 128, Max: 32768, ZeroAllowed: false, DynamicAllowed: true},
|
||||||
|
"gemini-claude-sonnet-4-5-thinking": {Min: 1024, Max: 200000, ZeroAllowed: false, DynamicAllowed: true},
|
||||||
|
"gemini-claude-opus-4-5-thinking": {Min: 1024, Max: 200000, ZeroAllowed: false, DynamicAllowed: true},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetIFlowModels returns supported models for iFlow OAuth accounts.
|
||||||
func GetIFlowModels() []*ModelInfo {
|
func GetIFlowModels() []*ModelInfo {
|
||||||
entries := []struct {
|
entries := []struct {
|
||||||
ID string
|
ID string
|
||||||
|
|||||||
@@ -366,29 +366,25 @@ func FetchAntigravityModels(ctx context.Context, auth *cliproxyauth.Auth, cfg *c
|
|||||||
}
|
}
|
||||||
|
|
||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
|
thinkingConfig := registry.GetAntigravityThinkingConfig()
|
||||||
models := make([]*registry.ModelInfo, 0, len(result.Map()))
|
models := make([]*registry.ModelInfo, 0, len(result.Map()))
|
||||||
for id := range result.Map() {
|
for originalName := range result.Map() {
|
||||||
id = modelName2Alias(id)
|
aliasName := modelName2Alias(originalName)
|
||||||
if id != "" {
|
if aliasName != "" {
|
||||||
modelInfo := ®istry.ModelInfo{
|
modelInfo := ®istry.ModelInfo{
|
||||||
ID: id,
|
ID: aliasName,
|
||||||
Name: id,
|
Name: aliasName,
|
||||||
Description: id,
|
Description: aliasName,
|
||||||
DisplayName: id,
|
DisplayName: aliasName,
|
||||||
Version: id,
|
Version: aliasName,
|
||||||
Object: "model",
|
Object: "model",
|
||||||
Created: now,
|
Created: now,
|
||||||
OwnedBy: antigravityAuthType,
|
OwnedBy: antigravityAuthType,
|
||||||
Type: antigravityAuthType,
|
Type: antigravityAuthType,
|
||||||
}
|
}
|
||||||
// Add Thinking support for thinking models
|
// Look up Thinking support from static config using alias name
|
||||||
if strings.HasSuffix(id, "-thinking") || strings.Contains(id, "-thinking-") {
|
if thinking, ok := thinkingConfig[aliasName]; ok {
|
||||||
modelInfo.Thinking = ®istry.ThinkingSupport{
|
modelInfo.Thinking = thinking
|
||||||
Min: 1024,
|
|
||||||
Max: 100000,
|
|
||||||
ZeroAllowed: false,
|
|
||||||
DynamicAllowed: true,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
models = append(models, modelInfo)
|
models = append(models, modelInfo)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user