Fix attachments being sent on irregular generation types Fixes #2763

0db9bc65916a727b26537a404cba43586c12e588

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

1 files changed, +10 -1Showing whitespace changes
public/script.js+10 -1
@@ -3477,8 +3477,17 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
3477 //PRE FORMATING STRING3477 //PRE FORMATING STRING
3478 //*********************************3478 //*********************************
34793479
3480 // These generation types should not attach pending files to the chat
3481 const noAttachTypes = [
3482 'regenerate',
3483 'swipe',
3484 'impersonate',
3485 'quiet',
3486 'continue',
3487 'ask_command',
3488 ];
3480 //for normal messages sent from user..3489 //for normal messages sent from user..
3481 if ((textareaText != '' || hasPendingFileAttachment()) && !automatic_trigger && type !== 'quiet' && !dryRun) {3490 if ((textareaText != '' || (hasPendingFileAttachment() && !noAttachTypes.includes(type))) && !automatic_trigger && type !== 'quiet' && !dryRun) {
3482 // If user message contains no text other than bias - send as a system message3491 // If user message contains no text other than bias - send as a system message
3483 if (messageBias && !removeMacros(textareaText)) {3492 if (messageBias && !removeMacros(textareaText)) {
3484 sendSystemMessage(system_message_types.GENERIC, ' ', { bias: messageBias });3493 sendSystemMessage(system_message_types.GENERIC, ' ', { bias: messageBias });