Support MistralAI streaming tool calls
| @@ -278,9 +278,9 @@ export class ToolManager { | |||
| 278 | } | 278 | } |
| 279 | 279 | ||
| 280 | for (const toolCallDelta of toolCallDeltas) { | 280 | for (const toolCallDelta of toolCallDeltas) { |
| 281 | const toolCallIndex = (typeof toolCallDelta?.index === 'number') ? toolCallDelta.index : null; | 281 | const toolCallIndex = (typeof toolCallDelta?.index === 'number') ? toolCallDelta.index : toolCallDeltas.indexOf(toolCallDelta); |
| 282 | 282 | ||
| 283 | if (toolCallIndex === null) { | 283 | if (isNaN(toolCallIndex) || toolCallIndex < 0) { |
| 284 | continue; | 284 | continue; |
| 285 | } | 285 | } |
| 286 | 286 | ||