From 424c745cbb957287ff018d12cfd35acd8579a5f2 Mon Sep 17 00:00:00 2001 From: shilin66 <15151873958@163.com> Date: Thu, 12 Sep 2024 14:19:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Stream=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E4=BD=BF=E7=94=A8toolChoice,toolCall=E7=9A=84function=E5=92=8C?= =?UTF-8?q?type=E5=8F=AF=E8=83=BD=E4=B8=BAnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/workflow/dispatch/agent/runTool/toolChoice.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts b/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts index 4be3a5eed..b36cd96a6 100644 --- a/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts +++ b/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts @@ -423,8 +423,8 @@ async function streamResponse({ // Start call tool if (toolCall.id) { callingTool = { - name: toolCall.function.name || '', - arguments: toolCall.function.arguments || '' + name: toolCall.function?.name || '', + arguments: toolCall.function?.arguments || '' }; } else if (callingTool) { // Continue call @@ -442,6 +442,7 @@ async function streamResponse({ toolCalls.push({ ...toolCall, id: toolId, + type: 'function', function: toolFunction, toolName: toolNode.name, toolAvatar: toolNode.avatar