Commit 32440f2e by Calcium-Ion Committed by GitHub

Merge pull request #673 from Yan-Zero/main

fix: 转义 Gemini 工具调用中的反斜杠
parents b632c650 b7b23472
......@@ -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,
},
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment