Commit 14bd1b54 by 不吃辣不喝酒 Committed by GitHub

fix: toolCall.function.arguments maybe undefined (#2545)

当arg===undefined时,会导致 currentTool.function.arguments += arg; 字符串拼接出问题。
parent 450167c9
......@@ -432,7 +432,7 @@ async function streamResponse({
}
/* arg 插入最后一个工具的参数里 */
const arg: string = toolCall?.function?.arguments;
const arg: string = toolCall?.function?.arguments ?? '';
const currentTool = toolCalls[toolCalls.length - 1];
if (currentTool) {
......
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