Allow tool registration on swipes
| @@ -4472,7 +4472,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 4472 | 4472 | if (canPerformToolCalls && isStreamFinished && isStreamWithToolCalls) { |
| 4473 | 4473 | const lastMessage = chat[chat.length - 1]; |
| 4474 | 4474 | const hasToolCalls = ToolManager.hasToolCalls(streamingProcessor.toolCalls); |
| 4475 | 4475 | const shouldDeleteMessage = type !== 'swipe' && ['', '...'].includes(lastMessage?.mes) && ['', '...'].includes(streamingProcessor?.result); |
| 4476 | 4476 | hasToolCalls && shouldDeleteMessage && await deleteLastMessage(); |
| 4477 | 4477 | const invocationResult = await ToolManager.invokeFunctionTools(streamingProcessor.toolCalls); |
| 4478 | 4478 | if (hasToolCalls) { |
| @@ -4566,7 +4566,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 4566 | 4566 | |
| 4567 | 4567 | if (canPerformToolCalls) { |
| 4568 | 4568 | const hasToolCalls = ToolManager.hasToolCalls(data); |
| 4569 | 4569 | const shouldDeleteMessage = type !== 'swipe' && ['', '...'].includes(getMessage); |
| 4570 | 4570 | hasToolCalls && shouldDeleteMessage && await deleteLastMessage(); |
| 4571 | 4571 | const invocationResult = await ToolManager.invokeFunctionTools(data); |
| 4572 | 4572 | if (hasToolCalls) { |
| @@ -487,7 +487,7 @@ export class ToolManager { | ||
| 487 | 487 | * @returns {boolean} Whether tool calls can be performed for the given type |
| 488 | 488 | */ |
| 489 | 489 | static canPerformToolCalls(type) { |
| 490 | 490 | const noToolCallTypes = ['swipe', 'impersonate', 'quiet', 'continue']; |
| 491 | 491 | const isSupported = ToolManager.isToolCallingSupported(); |
| 492 | 492 | return isSupported && !noToolCallTypes.includes(type); |
| 493 | 493 | } |