mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
feat(antigravity): support canonical names for antigravity models
This commit is contained in:
@@ -991,16 +991,19 @@ func GetIFlowModels() []*ModelInfo {
|
|||||||
type AntigravityModelConfig struct {
|
type AntigravityModelConfig struct {
|
||||||
Thinking *ThinkingSupport
|
Thinking *ThinkingSupport
|
||||||
MaxCompletionTokens int
|
MaxCompletionTokens int
|
||||||
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAntigravityModelConfig returns static configuration for antigravity models.
|
// GetAntigravityModelConfig returns static configuration for antigravity models.
|
||||||
// Keys use the ALIASED model names (after modelName2Alias conversion) for direct lookup.
|
// Keys use the ALIASED model names (after modelName2Alias conversion) for direct lookup.
|
||||||
func GetAntigravityModelConfig() map[string]*AntigravityModelConfig {
|
func GetAntigravityModelConfig() map[string]*AntigravityModelConfig {
|
||||||
return map[string]*AntigravityModelConfig{
|
return map[string]*AntigravityModelConfig{
|
||||||
"gemini-2.5-flash": {Thinking: &ThinkingSupport{Min: 0, Max: 24576, ZeroAllowed: true, DynamicAllowed: true}},
|
"gemini-2.5-flash": {Thinking: &ThinkingSupport{Min: 0, Max: 24576, ZeroAllowed: true, DynamicAllowed: true}, Name: "models/gemini-2.5-flash"},
|
||||||
"gemini-2.5-flash-lite": {Thinking: &ThinkingSupport{Min: 0, Max: 24576, ZeroAllowed: true, DynamicAllowed: true}},
|
"gemini-2.5-flash-lite": {Thinking: &ThinkingSupport{Min: 0, Max: 24576, ZeroAllowed: true, DynamicAllowed: true}, Name: "models/gemini-2.5-flash-lite"},
|
||||||
"gemini-3-pro-preview": {Thinking: &ThinkingSupport{Min: 128, Max: 32768, ZeroAllowed: false, DynamicAllowed: true}},
|
"gemini-2.5-computer-use-preview-10-2025": {Name: "models/gemini-2.5-computer-use-preview-10-2025"},
|
||||||
"gemini-claude-sonnet-4-5-thinking": {Thinking: &ThinkingSupport{Min: 1024, Max: 200000, ZeroAllowed: false, DynamicAllowed: true}, MaxCompletionTokens: 64000},
|
"gemini-3-pro-preview": {Thinking: &ThinkingSupport{Min: 128, Max: 32768, ZeroAllowed: false, DynamicAllowed: true}, Name: "models/gemini-3-pro-preview"},
|
||||||
"gemini-claude-opus-4-5-thinking": {Thinking: &ThinkingSupport{Min: 1024, Max: 200000, ZeroAllowed: false, DynamicAllowed: true}, MaxCompletionTokens: 64000},
|
"gemini-3-pro-image-preview": {Thinking: &ThinkingSupport{Min: 128, Max: 32768, ZeroAllowed: false, DynamicAllowed: true}, Name: "models/gemini-3-pro-image-preview"},
|
||||||
|
"gemini-claude-sonnet-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},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,9 +373,14 @@ func FetchAntigravityModels(ctx context.Context, auth *cliproxyauth.Auth, cfg *c
|
|||||||
for originalName := range result.Map() {
|
for originalName := range result.Map() {
|
||||||
aliasName := modelName2Alias(originalName)
|
aliasName := modelName2Alias(originalName)
|
||||||
if aliasName != "" {
|
if aliasName != "" {
|
||||||
|
cfg := modelConfig[aliasName]
|
||||||
|
modelName := aliasName
|
||||||
|
if cfg != nil && cfg.Name != "" {
|
||||||
|
modelName = cfg.Name
|
||||||
|
}
|
||||||
modelInfo := ®istry.ModelInfo{
|
modelInfo := ®istry.ModelInfo{
|
||||||
ID: aliasName,
|
ID: aliasName,
|
||||||
Name: aliasName,
|
Name: modelName,
|
||||||
Description: aliasName,
|
Description: aliasName,
|
||||||
DisplayName: aliasName,
|
DisplayName: aliasName,
|
||||||
Version: aliasName,
|
Version: aliasName,
|
||||||
@@ -385,7 +390,7 @@ func FetchAntigravityModels(ctx context.Context, auth *cliproxyauth.Auth, cfg *c
|
|||||||
Type: antigravityAuthType,
|
Type: antigravityAuthType,
|
||||||
}
|
}
|
||||||
// Look up Thinking support from static config using alias name
|
// Look up Thinking support from static config using alias name
|
||||||
if cfg, ok := modelConfig[aliasName]; ok {
|
if cfg != nil {
|
||||||
if cfg.Thinking != nil {
|
if cfg.Thinking != nil {
|
||||||
modelInfo.Thinking = cfg.Thinking
|
modelInfo.Thinking = cfg.Thinking
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user