fix: 默认补全 antigravity 的 Gemini 3.1 Pro 透传映射

This commit is contained in:
cagedbird043
2026-02-24 22:35:21 +08:00
parent 516f8f287c
commit a3aed3c4c3
2 changed files with 24 additions and 2 deletions

View File

@@ -373,7 +373,11 @@ func (a *Account) GetModelMapping() map[string]string {
}
if len(result) > 0 {
if a.Platform == domain.PlatformAntigravity {
ensureAntigravityDefaultPassthrough(result, "gemini-3-flash")
ensureAntigravityDefaultPassthroughs(result, []string{
"gemini-3-flash",
"gemini-3.1-pro-high",
"gemini-3.1-pro-low",
})
}
return result
}
@@ -400,6 +404,12 @@ func ensureAntigravityDefaultPassthrough(mapping map[string]string, model string
mapping[model] = model
}
func ensureAntigravityDefaultPassthroughs(mapping map[string]string, models []string) {
for _, model := range models {
ensureAntigravityDefaultPassthrough(mapping, model)
}
}
// IsModelSupported 检查模型是否在 model_mapping 中(支持通配符)
// 如果未配置 mapping返回 true允许所有模型
func (a *Account) IsModelSupported(requestedModel string) bool {