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
8add0b15
authored
Jun 06, 2025
by
RedwindA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决合并冲突
parent
2c3464c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
relay/channel/gemini/relay-gemini.go
+15
-2
No files found.
relay/channel/gemini/relay-gemini.go
View file @
8add0b15
...
...
@@ -58,8 +58,21 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon
if
model_setting
.
GetGeminiSettings
()
.
ThinkingAdapterEnabled
{
if
strings
.
HasSuffix
(
info
.
OriginModelName
,
"-thinking"
)
{
// 如果模型名以 gemini-2.5-pro 开头,不设置 ThinkingBudget
if
strings
.
HasPrefix
(
info
.
OriginModelName
,
"gemini-2.5-pro"
)
{
// 硬编码不支持 ThinkingBudget 的旧模型
unsupportedModels
:=
[]
string
{
"gemini-2.5-pro-preview-05-06"
,
"gemini-2.5-pro-preview-03-25"
,
}
isUnsupported
:=
false
for
_
,
unsupportedModel
:=
range
unsupportedModels
{
if
strings
.
HasPrefix
(
info
.
OriginModelName
,
unsupportedModel
)
{
isUnsupported
=
true
break
}
}
if
isUnsupported
{
geminiRequest
.
GenerationConfig
.
ThinkingConfig
=
&
GeminiThinkingConfig
{
IncludeThoughts
:
true
,
}
...
...
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