mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-03 03:17:54 +01:00
Do not double-parse WI content on "always on"
This commit is contained in:
parent
0587931cae
commit
b9d72bfdf4
@ -2373,7 +2373,6 @@ async function checkWorldInfo(chat, maxContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (entry.constant || buffer.isExternallyActivated(entry)) {
|
if (entry.constant || buffer.isExternallyActivated(entry)) {
|
||||||
entry.content = substituteParams(entry.content);
|
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -2466,7 +2465,9 @@ async function checkWorldInfo(chat, maxContext) {
|
|||||||
continue;
|
continue;
|
||||||
} else { console.debug(`uid:${entry.uid} passed probability check, inserting to prompt`); }
|
} else { console.debug(`uid:${entry.uid} passed probability check, inserting to prompt`); }
|
||||||
|
|
||||||
newContent += `${substituteParams(entry.content)}\n`;
|
// Substitute macros inline, for both this checking and also future processing
|
||||||
|
entry.content = substituteParams(entry.content);
|
||||||
|
newContent += `${entry.content}\n`;
|
||||||
|
|
||||||
if ((textToScanTokens + (await getTokenCountAsync(newContent))) >= budget) {
|
if ((textToScanTokens + (await getTokenCountAsync(newContent))) >= budget) {
|
||||||
console.debug('WI budget reached, stopping');
|
console.debug('WI budget reached, stopping');
|
||||||
@ -2499,7 +2500,7 @@ async function checkWorldInfo(chat, maxContext) {
|
|||||||
const text = newEntries
|
const text = newEntries
|
||||||
.filter(x => !failedProbabilityChecks.has(x))
|
.filter(x => !failedProbabilityChecks.has(x))
|
||||||
.filter(x => !x.preventRecursion)
|
.filter(x => !x.preventRecursion)
|
||||||
.map(x => substituteParams(x.content)).join('\n');
|
.map(x => x.content).join('\n');
|
||||||
buffer.addRecurse(text);
|
buffer.addRecurse(text);
|
||||||
allActivatedText = (text + '\n' + allActivatedText);
|
allActivatedText = (text + '\n' + allActivatedText);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user