Allow tool registration on swipes

89bad2188185af9c95f27bd0bc6e066d8001e868

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

2 files changed, +3 -3Ignore whitespace
public/script.js+2 -2
@@ -4472,7 +4472,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
44724472 if (canPerformToolCalls && isStreamFinished && isStreamWithToolCalls) {
44734473 const lastMessage = chat[chat.length - 1];
44744474 const hasToolCalls = ToolManager.hasToolCalls(streamingProcessor.toolCalls);
44754475 const shouldDeleteMessage = type !== 'swipe' && ['', '...'].includes(lastMessage?.mes) && ['', '...'].includes(streamingProcessor?.result);
44764476 hasToolCalls && shouldDeleteMessage && await deleteLastMessage();
44774477 const invocationResult = await ToolManager.invokeFunctionTools(streamingProcessor.toolCalls);
44784478 if (hasToolCalls) {
@@ -4566,7 +4566,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
45664566
45674567 if (canPerformToolCalls) {
45684568 const hasToolCalls = ToolManager.hasToolCalls(data);
45694569 const shouldDeleteMessage = type !== 'swipe' && ['', '...'].includes(getMessage);
45704570 hasToolCalls && shouldDeleteMessage && await deleteLastMessage();
45714571 const invocationResult = await ToolManager.invokeFunctionTools(data);
45724572 if (hasToolCalls) {
public/scripts/tool-calling.js+1 -1
@@ -487,7 +487,7 @@ export class ToolManager {
487487 * @returns {boolean} Whether tool calls can be performed for the given type
488488 */
489489 static canPerformToolCalls(type) {
490490 const noToolCallTypes = ['swipe', 'impersonate', 'quiet', 'continue'];
491491 const isSupported = ToolManager.isToolCallingSupported();
492492 return isSupported && !noToolCallTypes.includes(type);
493493 }