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
32440f2e
authored
Dec 28, 2024
by
Calcium-Ion
Committed by
GitHub
Dec 28, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #673 from Yan-Zero/main
fix: 转义 Gemini 工具调用中的反斜杠
parents
b632c650
b7b23472
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
relay/channel/gemini/relay-gemini.go
+2
-1
No files found.
relay/channel/gemini/relay-gemini.go
View file @
32440f2e
...
@@ -296,7 +296,8 @@ func getToolCall(item *GeminiPart) *dto.ToolCall {
...
@@ -296,7 +296,8 @@ func getToolCall(item *GeminiPart) *dto.ToolCall {
ID
:
fmt
.
Sprintf
(
"call_%s"
,
common
.
GetUUID
()),
ID
:
fmt
.
Sprintf
(
"call_%s"
,
common
.
GetUUID
()),
Type
:
"function"
,
Type
:
"function"
,
Function
:
dto
.
FunctionCall
{
Function
:
dto
.
FunctionCall
{
Arguments
:
string
(
argsBytes
),
// 不好评价,得去转义一下反斜杠,Gemini 的特性好像是,Google 返回的时候本身就会转义“\”
Arguments
:
strings
.
ReplaceAll
(
string
(
argsBytes
),
"
\\\\
"
,
"
\\
"
),
Name
:
item
.
FunctionCall
.
FunctionName
,
Name
:
item
.
FunctionCall
.
FunctionName
,
},
},
}
}
...
...
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