Skip to content

Commit

Permalink
Merge pull request #673 from Yan-Zero/main
Browse files Browse the repository at this point in the history
fix: 转义 Gemini 工具调用中的反斜杠
  • Loading branch information
Calcium-Ion authored Dec 28, 2024
2 parents 458dd1b + 72dc543 commit 91b777f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion relay/channel/gemini/relay-gemini.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ func getToolCall(item *GeminiPart) *dto.ToolCall {
ID: fmt.Sprintf("call_%s", common.GetUUID()),
Type: "function",
Function: dto.FunctionCall{
Arguments: string(argsBytes),
// 不好评价,得去转义一下反斜杠,Gemini 的特性好像是,Google 返回的时候本身就会转义“\”
Arguments: strings.ReplaceAll(string(argsBytes), "\\\\", "\\"),
Name: item.FunctionCall.FunctionName,
},
}
Expand Down

0 comments on commit 91b777f

Please sign in to comment.