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
7601f7f9
authored
Jun 06, 2025
by
Calcium-Ion
Committed by
GitHub
Jun 06, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1167 from RedwindA/feat/2.5-pro-thinkingBudget
Feat: 2.5-pro thinkingBudget
parents
508188ca
d84da74a
Show 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 @
7601f7f9
...
@@ -58,8 +58,21 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon
...
@@ -58,8 +58,21 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon
if
model_setting
.
GetGeminiSettings
()
.
ThinkingAdapterEnabled
{
if
model_setting
.
GetGeminiSettings
()
.
ThinkingAdapterEnabled
{
if
strings
.
HasSuffix
(
info
.
OriginModelName
,
"-thinking"
)
{
if
strings
.
HasSuffix
(
info
.
OriginModelName
,
"-thinking"
)
{
// 如果模型名以 gemini-2.5-pro 开头,不设置 ThinkingBudget
// 硬编码不支持 ThinkingBudget 的旧模型
if
strings
.
HasPrefix
(
info
.
OriginModelName
,
"gemini-2.5-pro"
)
{
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
{
geminiRequest
.
GenerationConfig
.
ThinkingConfig
=
&
GeminiThinkingConfig
{
IncludeThoughts
:
true
,
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