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
fa89410e
authored
May 04, 2025
by
Calcium-Ion
Committed by
GitHub
May 04, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1012 from tbphp/vertex_thinking_support
feat: support thinking suffix for vertex gemini channel
parents
4bf0d094
5b81e88e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
relay/channel/vertex/adaptor.go
+10
-0
No files found.
relay/channel/vertex/adaptor.go
View file @
fa89410e
...
@@ -12,6 +12,7 @@ import (
...
@@ -12,6 +12,7 @@ import (
"one-api/relay/channel/claude"
"one-api/relay/channel/claude"
"one-api/relay/channel/gemini"
"one-api/relay/channel/gemini"
"one-api/relay/channel/openai"
"one-api/relay/channel/openai"
"one-api/setting/model_setting"
relaycommon
"one-api/relay/common"
relaycommon
"one-api/relay/common"
"strings"
"strings"
)
)
...
@@ -77,6 +78,15 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
...
@@ -77,6 +78,15 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
a
.
AccountCredentials
=
*
adc
a
.
AccountCredentials
=
*
adc
suffix
:=
""
suffix
:=
""
if
a
.
RequestMode
==
RequestModeGemini
{
if
a
.
RequestMode
==
RequestModeGemini
{
if
model_setting
.
GetGeminiSettings
()
.
ThinkingAdapterEnabled
{
// suffix -thinking and -nothinking
if
strings
.
HasSuffix
(
info
.
OriginModelName
,
"-thinking"
)
{
info
.
UpstreamModelName
=
strings
.
TrimSuffix
(
info
.
UpstreamModelName
,
"-thinking"
)
}
else
if
strings
.
HasSuffix
(
info
.
OriginModelName
,
"-nothinking"
)
{
info
.
UpstreamModelName
=
strings
.
TrimSuffix
(
info
.
UpstreamModelName
,
"-nothinking"
)
}
}
if
info
.
IsStream
{
if
info
.
IsStream
{
suffix
=
"streamGenerateContent?alt=sse"
suffix
=
"streamGenerateContent?alt=sse"
}
else
{
}
else
{
...
...
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