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
b2d3fa5d
authored
Oct 04, 2025
by
Moment
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Gemini missing func name for multi-streaming tool calls (except the first).
parent
9aaa0f48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
relay/channel/gemini/relay-gemini.go
+9
-3
No files found.
relay/channel/gemini/relay-gemini.go
View file @
b2d3fa5d
...
@@ -961,9 +961,15 @@ func GeminiChatStreamHandler(c *gin.Context, info *relaycommon.RelayInfo, resp *
...
@@ -961,9 +961,15 @@ func GeminiChatStreamHandler(c *gin.Context, info *relaycommon.RelayInfo, resp *
// send first response
// send first response
emptyResponse
:=
helper
.
GenerateStartEmptyResponse
(
id
,
createAt
,
info
.
UpstreamModelName
,
nil
)
emptyResponse
:=
helper
.
GenerateStartEmptyResponse
(
id
,
createAt
,
info
.
UpstreamModelName
,
nil
)
if
response
.
IsToolCall
()
{
if
response
.
IsToolCall
()
{
emptyResponse
.
Choices
[
0
]
.
Delta
.
ToolCalls
=
make
([]
dto
.
ToolCallResponse
,
1
)
if
len
(
emptyResponse
.
Choices
)
>
0
&&
len
(
response
.
Choices
)
>
0
{
emptyResponse
.
Choices
[
0
]
.
Delta
.
ToolCalls
[
0
]
=
*
response
.
GetFirstToolCall
()
toolCalls
:=
response
.
Choices
[
0
]
.
Delta
.
ToolCalls
emptyResponse
.
Choices
[
0
]
.
Delta
.
ToolCalls
[
0
]
.
Function
.
Arguments
=
""
copiedToolCalls
:=
make
([]
dto
.
ToolCallResponse
,
len
(
toolCalls
))
for
idx
:=
range
toolCalls
{
copiedToolCalls
[
idx
]
=
toolCalls
[
idx
]
copiedToolCalls
[
idx
]
.
Function
.
Arguments
=
""
}
emptyResponse
.
Choices
[
0
]
.
Delta
.
ToolCalls
=
copiedToolCalls
}
finishReason
=
constant
.
FinishReasonToolCalls
finishReason
=
constant
.
FinishReasonToolCalls
err
=
handleStream
(
c
,
info
,
emptyResponse
)
err
=
handleStream
(
c
,
info
,
emptyResponse
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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