Merge pull request #2199 from steve02081504/patch-4

remove empty entrys from WIs
This commit is contained in:
Cohee 2024-05-09 15:05:25 +03:00 committed by GitHub
commit 535da63e52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -2534,6 +2534,11 @@ async function checkWorldInfo(chat, maxContext) {
const regexDepth = entry.position === world_info_position.atDepth ? (entry.depth ?? DEFAULT_DEPTH) : null;
const content = getRegexedString(entry.content, regex_placement.WORLD_INFO, { depth: regexDepth, isMarkdown: false, isPrompt: true });
if (!content) {
console.debug('Skipping adding WI entry to prompt due to empty content:', entry);
return;
}
switch (entry.position) {
case world_info_position.before:
WIBeforeEntries.unshift(substituteParams(content));