Tool Calling: Don't try to parse if tool calling is not supported

3fd7ca90ed2ce5d8c65ebbbc3477e5ad4a198e18

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -0Ignore whitespace
public/scripts/tool-calling.js+3 -0
@@ -365,6 +365,9 @@ export class ToolManager {
365365 * @returns {void}
366366 */
367367 static parseToolCalls(toolCalls, parsed) {
368+ if (!this.isToolCallingSupported()) {
369+ return;
370+ }
368371 if (Array.isArray(parsed?.choices)) {
369372 for (const choice of parsed.choices) {
370373 const choiceIndex = (typeof choice.index === 'number') ? choice.index : null;