From 0db9bc65916a727b26537a404cba43586c12e588 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 8 Sep 2024 18:11:38 +0300 Subject: [PATCH] Fix attachments being sent on irregular generation types Fixes #2763 --- public/script.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 3a8d5f525..372994fb2 100644 --- a/public/script.js +++ b/public/script.js @@ -3477,8 +3477,17 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro //PRE FORMATING STRING //********************************* + // These generation types should not attach pending files to the chat + const noAttachTypes = [ + 'regenerate', + 'swipe', + 'impersonate', + 'quiet', + 'continue', + 'ask_command', + ]; //for normal messages sent from user.. - if ((textareaText != '' || hasPendingFileAttachment()) && !automatic_trigger && type !== 'quiet' && !dryRun) { + if ((textareaText != '' || (hasPendingFileAttachment() && !noAttachTypes.includes(type))) && !automatic_trigger && type !== 'quiet' && !dryRun) { // If user message contains no text other than bias - send as a system message if (messageBias && !removeMacros(textareaText)) { sendSystemMessage(system_message_types.GENERIC, ' ', { bias: messageBias });