Commit d87771a1 by Archer Committed by GitHub

fix: toolcall index not start zero (#5811)

parent 68271c08
......@@ -243,7 +243,7 @@ export const createStreamResponse = async ({
type: 'function',
function: callingTool!
};
toolCalls.push(call);
toolCalls[index] = call;
onToolCall?.({ call });
callingTool = null;
}
......@@ -268,7 +268,7 @@ export const createStreamResponse = async ({
reasoningText: reasoningContent,
finish_reason,
usage,
toolCalls
toolCalls: toolCalls.filter((call) => !!call)
};
} else {
let startResponseWrite = false;
......
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