mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-13 18:40:11 +01:00
Allow tool registration on swipes
This commit is contained in:
parent
6b022e783d
commit
89bad21881
@ -4472,7 +4472,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
||||
if (canPerformToolCalls && isStreamFinished && isStreamWithToolCalls) {
|
||||
const lastMessage = chat[chat.length - 1];
|
||||
const hasToolCalls = ToolManager.hasToolCalls(streamingProcessor.toolCalls);
|
||||
const shouldDeleteMessage = ['', '...'].includes(lastMessage?.mes) && ['', '...'].includes(streamingProcessor?.result);
|
||||
const shouldDeleteMessage = type !== 'swipe' && ['', '...'].includes(lastMessage?.mes) && ['', '...'].includes(streamingProcessor?.result);
|
||||
hasToolCalls && shouldDeleteMessage && await deleteLastMessage();
|
||||
const invocationResult = await ToolManager.invokeFunctionTools(streamingProcessor.toolCalls);
|
||||
if (hasToolCalls) {
|
||||
@ -4566,7 +4566,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
||||
|
||||
if (canPerformToolCalls) {
|
||||
const hasToolCalls = ToolManager.hasToolCalls(data);
|
||||
const shouldDeleteMessage = ['', '...'].includes(getMessage);
|
||||
const shouldDeleteMessage = type !== 'swipe' && ['', '...'].includes(getMessage);
|
||||
hasToolCalls && shouldDeleteMessage && await deleteLastMessage();
|
||||
const invocationResult = await ToolManager.invokeFunctionTools(data);
|
||||
if (hasToolCalls) {
|
||||
|
@ -487,7 +487,7 @@ export class ToolManager {
|
||||
* @returns {boolean} Whether tool calls can be performed for the given type
|
||||
*/
|
||||
static canPerformToolCalls(type) {
|
||||
const noToolCallTypes = ['swipe', 'impersonate', 'quiet', 'continue'];
|
||||
const noToolCallTypes = ['impersonate', 'quiet', 'continue'];
|
||||
const isSupported = ToolManager.isToolCallingSupported();
|
||||
return isSupported && !noToolCallTypes.includes(type);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user