| 365 | * @returns {void} | 365 | * @returns {void} |
| 366 | */ | 366 | */ |
| 367 | static parseToolCalls(toolCalls, parsed) { | 367 | static parseToolCalls(toolCalls, parsed) { |
| | 368 | if (!this.isToolCallingSupported()) { |
| | 369 | return; |
| | 370 | } |
| 368 | if (Array.isArray(parsed?.choices)) { | 371 | if (Array.isArray(parsed?.choices)) { |
| 369 | for (const choice of parsed.choices) { | 372 | for (const choice of parsed.choices) { |
| 370 | const choiceIndex = (typeof choice.index === 'number') ? choice.index : null; | 373 | const choiceIndex = (typeof choice.index === 'number') ? choice.index : null; |