Fix generation looping

6a304e888426439f63d76d8b34505f4317e65834

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

1 files changed, +2 -1Ignore whitespace
public/scripts/tool-calling.js+2 -1
@@ -459,7 +459,8 @@ export class ToolManager {
459 * @returns {boolean} Whether the response data contains tool calls459 * @returns {boolean} Whether the response data contains tool calls
460 */460 */
461 static hasToolCalls(data) {461 static hasToolCalls(data) {
462 return Array.isArray(ToolManager.#getToolCallsFromData(data));462 const toolCalls = ToolManager.#getToolCallsFromData(data);
463 return Array.isArray(toolCalls) && toolCalls.length > 0;
463 }464 }
464465
465 /**466 /**