Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
0dd6986e
Unverified
Commit
0dd6986e
authored
Feb 26, 2026
by
Wesley Liddick
Committed by
GitHub
Feb 26, 2026
Browse files
Merge pull request #639 from cagedbird043/pr/refactor-antigravity-model-source
refactor(admin): 消除测试连接 Gemini 模型硬编码,统一由 DefaultModels 提供
parents
6d0102a7
ba69736f
Changes
1
Show whitespace changes
Inline
Side-by-side
backend/internal/handler/admin/account_handler.go
View file @
0dd6986e
...
...
@@ -16,6 +16,7 @@ import (
"github.com/Wei-Shaw/sub2api/internal/domain"
"github.com/Wei-Shaw/sub2api/internal/handler/dto"
"github.com/Wei-Shaw/sub2api/internal/pkg/antigravity"
"github.com/Wei-Shaw/sub2api/internal/pkg/claude"
"github.com/Wei-Shaw/sub2api/internal/pkg/geminicli"
"github.com/Wei-Shaw/sub2api/internal/pkg/openai"
...
...
@@ -1459,36 +1460,8 @@ func (h *AccountHandler) GetAvailableModels(c *gin.Context) {
// Handle Antigravity accounts: return Claude + Gemini models
if
account
.
Platform
==
service
.
PlatformAntigravity
{
// Antigravity 支持 Claude 和部分 Gemini 模型
type
UnifiedModel
struct
{
ID
string
`json:"id"`
Type
string
`json:"type"`
DisplayName
string
`json:"display_name"`
}
var
models
[]
UnifiedModel
// 添加 Claude 模型
for
_
,
m
:=
range
claude
.
DefaultModels
{
models
=
append
(
models
,
UnifiedModel
{
ID
:
m
.
ID
,
Type
:
m
.
Type
,
DisplayName
:
m
.
DisplayName
,
})
}
// 添加 Gemini 3 系列模型用于测试
geminiTestModels
:=
[]
UnifiedModel
{
{
ID
:
"gemini-3-flash"
,
Type
:
"model"
,
DisplayName
:
"Gemini 3 Flash"
},
{
ID
:
"gemini-3-pro-low"
,
Type
:
"model"
,
DisplayName
:
"Gemini 3 Pro Low"
},
{
ID
:
"gemini-3-pro-high"
,
Type
:
"model"
,
DisplayName
:
"Gemini 3 Pro High"
},
{
ID
:
"gemini-3.1-pro-low"
,
Type
:
"model"
,
DisplayName
:
"Gemini 3.1 Pro Low"
},
{
ID
:
"gemini-3.1-pro-high"
,
Type
:
"model"
,
DisplayName
:
"Gemini 3.1 Pro High"
},
{
ID
:
"gemini-3-pro-preview"
,
Type
:
"model"
,
DisplayName
:
"Gemini 3 Pro Preview"
},
}
models
=
append
(
models
,
geminiTestModels
...
)
response
.
Success
(
c
,
models
)
// 直接复用 antigravity.DefaultModels(),与 /v1/models 端点保持同步
response
.
Success
(
c
,
antigravity
.
DefaultModels
())
return
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment