Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
db96248c
authored
Jan 09, 2026
by
RedwindA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(gemini): 更新 GeminiModelsResponse 以使用 dto.GeminiModel 类型
parent
e8eea5d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
relay/channel/gemini/relay-gemini.go
+6
-12
No files found.
relay/channel/gemini/relay-gemini.go
View file @
db96248c
...
...
@@ -1366,18 +1366,8 @@ func GeminiImageHandler(c *gin.Context, info *relaycommon.RelayInfo, resp *http.
return
usage
,
nil
}
type
GeminiModelInfo
struct
{
Name
string
`json:"name"`
Version
string
`json:"version"`
DisplayName
string
`json:"displayName"`
Description
string
`json:"description"`
InputTokenLimit
int
`json:"inputTokenLimit"`
OutputTokenLimit
int
`json:"outputTokenLimit"`
SupportedGenerationMethods
[]
string
`json:"supportedGenerationMethods"`
}
type
GeminiModelsResponse
struct
{
Models
[]
GeminiModelInfo
`json:"models"`
Models
[]
dto
.
GeminiModel
`json:"models"`
NextPageToken
string
`json:"nextPageToken"`
}
...
...
@@ -1432,7 +1422,11 @@ func FetchGeminiModels(baseURL, apiKey, proxyURL string) ([]string, error) {
}
for
_
,
model
:=
range
modelsResponse
.
Models
{
modelName
:=
strings
.
TrimPrefix
(
model
.
Name
,
"models/"
)
modelNameValue
,
ok
:=
model
.
Name
.
(
string
)
if
!
ok
{
continue
}
modelName
:=
strings
.
TrimPrefix
(
modelNameValue
,
"models/"
)
allModels
=
append
(
allModels
,
modelName
)
}
...
...
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