Support MistralAI streaming tool calls

This commit is contained in:
Cohee 2024-10-04 01:51:41 +03:00
parent 447a7fba68
commit 01f03dbf50

View File

@ -278,9 +278,9 @@ export class ToolManager {
}
for (const toolCallDelta of toolCallDeltas) {
const toolCallIndex = (typeof toolCallDelta?.index === 'number') ? toolCallDelta.index : null;
const toolCallIndex = (typeof toolCallDelta?.index === 'number') ? toolCallDelta.index : toolCallDeltas.indexOf(toolCallDelta);
if (toolCallIndex === null) {
if (isNaN(toolCallIndex) || toolCallIndex < 0) {
continue;
}