Fix attachments being sent on irregular generation types

Fixes #2763
This commit is contained in:
Cohee 2024-09-08 18:11:38 +03:00
parent 5e522d6e35
commit 0db9bc6591

View File

@ -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 });