Tool Calling: Don't try to parse if tool calling is not supported
| @@ -365,6 +365,9 @@ export class ToolManager { | ||
| 365 | 365 | * @returns {void} |
| 366 | 366 | */ |
| 367 | 367 | static parseToolCalls(toolCalls, parsed) { |
| 368 | + if (!this.isToolCallingSupported()) { | |
| 369 | + return; | |
| 370 | + } | |
| 368 | 371 | if (Array.isArray(parsed?.choices)) { |
| 369 | 372 | for (const choice of parsed.choices) { |
| 370 | 373 | const choiceIndex = (typeof choice.index === 'number') ? choice.index : null; |