fix: antigravity 默认补全 gemini-3-flash 透传

This commit is contained in:
cagedbird043
2026-02-24 20:30:15 +08:00
parent 7be5e1734c
commit ea8104c6a2
2 changed files with 53 additions and 0 deletions

View File

@@ -372,6 +372,9 @@ func (a *Account) GetModelMapping() map[string]string {
}
}
if len(result) > 0 {
if a.Platform == domain.PlatformAntigravity {
ensureAntigravityDefaultPassthrough(result, "gemini-3-flash")
}
return result
}
}
@@ -382,6 +385,21 @@ func (a *Account) GetModelMapping() map[string]string {
return nil
}
func ensureAntigravityDefaultPassthrough(mapping map[string]string, model string) {
if mapping == nil || model == "" {
return
}
if _, exists := mapping[model]; exists {
return
}
for pattern := range mapping {
if matchWildcard(pattern, model) {
return
}
}
mapping[model] = model
}
// IsModelSupported 检查模型是否在 model_mapping 中(支持通配符)
// 如果未配置 mapping返回 true允许所有模型
func (a *Account) IsModelSupported(requestedModel string) bool {