mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
remove empty lines from WIs
This commit is contained in:
committed by
steve02081504
parent
0587931cae
commit
ff1399d1ba
@@ -2575,12 +2575,15 @@ async function checkWorldInfo(chat, maxContext) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const worldInfoBefore = WIBeforeEntries.length ? WIBeforeEntries.join('\n') : '';
|
//remove entries that are empty
|
||||||
const worldInfoAfter = WIAfterEntries.length ? WIAfterEntries.join('\n') : '';
|
let notempty = (entry) => entry !== ''
|
||||||
|
|
||||||
|
const worldInfoBefore = WIBeforeEntries.filter(notempty).join('\n');
|
||||||
|
const worldInfoAfter = WIAfterEntries.filter(notempty).join('\n');
|
||||||
|
|
||||||
if (shouldWIAddPrompt) {
|
if (shouldWIAddPrompt) {
|
||||||
const originalAN = context.extensionPrompts[NOTE_MODULE_NAME].value;
|
const originalAN = context.extensionPrompts[NOTE_MODULE_NAME].value;
|
||||||
const ANWithWI = `${ANTopEntries.join('\n')}\n${originalAN}\n${ANBottomEntries.join('\n')}`;
|
const ANWithWI = `${ANTopEntries.filter(notempty).join('\n')}\n${originalAN}\n${ANBottomEntries.filter(notempty).join('\n')}`;
|
||||||
context.setExtensionPrompt(NOTE_MODULE_NAME, ANWithWI, chat_metadata[metadata_keys.position], chat_metadata[metadata_keys.depth], extension_settings.note.allowWIScan, chat_metadata[metadata_keys.role]);
|
context.setExtensionPrompt(NOTE_MODULE_NAME, ANWithWI, chat_metadata[metadata_keys.position], chat_metadata[metadata_keys.depth], extension_settings.note.allowWIScan, chat_metadata[metadata_keys.role]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user