From 72dc54309c0b6bb41520e42d271595e8b2ab35a2 Mon Sep 17 00:00:00 2001 From: Yan <1964649083@qq.com> Date: Sat, 28 Dec 2024 18:29:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BD=AC=E4=B9=89=20Gemini=20=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E8=B0=83=E7=94=A8=E4=B8=AD=E7=9A=84=E5=8F=8D=E6=96=9C?= =?UTF-8?q?=E6=9D=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- relay/channel/gemini/relay-gemini.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/relay/channel/gemini/relay-gemini.go b/relay/channel/gemini/relay-gemini.go index dda84084d..01f21b312 100644 --- a/relay/channel/gemini/relay-gemini.go +++ b/relay/channel/gemini/relay-gemini.go @@ -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, }, }