mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
make decorator only parse once
This commit is contained in:
@ -3647,7 +3647,10 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
|||||||
for (let entry of sortedEntries) {
|
for (let entry of sortedEntries) {
|
||||||
|
|
||||||
//oarse decorators
|
//oarse decorators
|
||||||
const [decorators] = parseDecorators(entry.content);
|
const [decorators, content] = parseDecorators(entry.content);
|
||||||
|
entry.decorators = decorators;
|
||||||
|
entry.content = content;
|
||||||
|
|
||||||
if(decorators.includes('@@activate')){
|
if(decorators.includes('@@activate')){
|
||||||
//activate in any case
|
//activate in any case
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
@ -3820,7 +3823,7 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
|||||||
} else { console.debug(`uid:${entry.uid} passed probability check, inserting to prompt`); }
|
} else { console.debug(`uid:${entry.uid} passed probability check, inserting to prompt`); }
|
||||||
|
|
||||||
// Substitute macros inline, for both this checking and also future processing
|
// Substitute macros inline, for both this checking and also future processing
|
||||||
entry.content = substituteParams(parseDecorators(entry.content)[1]);
|
entry.content = substituteParams(entry.content);
|
||||||
newContent += `${entry.content}\n`;
|
newContent += `${entry.content}\n`;
|
||||||
|
|
||||||
if ((textToScanTokens + (await getTokenCountAsync(newContent))) >= budget) {
|
if ((textToScanTokens + (await getTokenCountAsync(newContent))) >= budget) {
|
||||||
|
Reference in New Issue
Block a user