From 502858d35d053c89e68e891a8e5ad53f1c86bfa7 Mon Sep 17 00:00:00 2001 From: skynono Date: Wed, 17 Jun 2026 17:07:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E5=85=B7=E8=B0=83=E7=94=A8=20a?= =?UTF-8?q?rguments=20=E4=B8=BA=E7=A9=BA=E6=97=B6=E4=BF=9D=E7=95=99=20tool?= =?UTF-8?q?=5Fuse=20=E5=9D=97=20(#5543)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- relay/channel/claude/relay-claude.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/relay/channel/claude/relay-claude.go b/relay/channel/claude/relay-claude.go index 18d7455e..0ba31b1b 100644 --- a/relay/channel/claude/relay-claude.go +++ b/relay/channel/claude/relay-claude.go @@ -410,9 +410,10 @@ func RequestOpenAI2ClaudeMessage(c *gin.Context, textRequest dto.GeneralOpenAIRe if message.ToolCalls != nil { for _, toolCall := range message.ParseToolCalls() { inputObj := make(map[string]any) - if err := json.Unmarshal([]byte(toolCall.Function.Arguments), &inputObj); err != nil { - common.SysLog("tool call function arguments is not a map[string]any: " + fmt.Sprintf("%v", toolCall.Function.Arguments)) - continue + if args := toolCall.Function.Arguments; args != "" { + if err := json.Unmarshal([]byte(args), &inputObj); err != nil { + common.SysLog("tool call function arguments is not a map[string]any: " + fmt.Sprintf("%v", toolCall.Function.Arguments)) + } } claudeMediaMessages = append(claudeMediaMessages, dto.ClaudeMediaMessage{ Type: "tool_use",