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
84a9a54a
authored
Jun 06, 2025
by
Calcium-Ion
Committed by
GitHub
Jun 06, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1166 from RedwindA/fix/gemini-functionResponse
Fix: Correctly relay FunctionResponse content for Gemini API
parents
7601f7f9
8add0b15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
relay/channel/gemini/dto.go
+2
-7
relay/channel/gemini/relay-gemini.go
+4
-9
No files found.
relay/channel/gemini/dto.go
View file @
84a9a54a
...
...
@@ -27,14 +27,9 @@ type FunctionCall struct {
Arguments
any
`json:"args"`
}
type
GeminiFunctionResponseContent
struct
{
Name
string
`json:"name"`
Content
any
`json:"content"`
}
type
FunctionResponse
struct
{
Name
string
`json:"name"`
Response
GeminiFunctionResponseContent
`json:"response"`
Name
string
`json:"name"`
Response
map
[
string
]
interface
{}
`json:"response"`
}
type
GeminiPartExecutableCode
struct
{
...
...
relay/channel/gemini/relay-gemini.go
View file @
84a9a54a
...
...
@@ -186,17 +186,12 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon
}
else
if
val
,
exists
:=
tool_call_ids
[
message
.
ToolCallId
];
exists
{
name
=
val
}
content
:=
common
.
StrToMap
(
message
.
StringContent
())
content
Map
:=
common
.
StrToMap
(
message
.
StringContent
())
functionResp
:=
&
FunctionResponse
{
Name
:
name
,
Response
:
GeminiFunctionResponseContent
{
Name
:
name
,
Content
:
content
,
},
}
if
content
==
nil
{
functionResp
.
Response
.
Content
=
message
.
StringContent
()
Name
:
name
,
Response
:
contentMap
,
}
*
parts
=
append
(
*
parts
,
GeminiPart
{
FunctionResponse
:
functionResp
,
})
...
...
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