mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Prefer const variables
This commit is contained in:
@@ -3325,18 +3325,18 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
|||||||
// Make quiet prompt available for WIAN
|
// Make quiet prompt available for WIAN
|
||||||
setExtensionPrompt('QUIET_PROMPT', quiet_prompt || '', extension_prompt_types.IN_PROMPT, 0, true);
|
setExtensionPrompt('QUIET_PROMPT', quiet_prompt || '', extension_prompt_types.IN_PROMPT, 0, true);
|
||||||
const chatForWI = coreChat.map(x => `${x.name}: ${x.mes}`).reverse();
|
const chatForWI = coreChat.map(x => `${x.name}: ${x.mes}`).reverse();
|
||||||
let { worldInfoString, worldInfoBefore, worldInfoAfter, worldInfoExamples, worldInfoDepth } = await getWorldInfoPrompt(chatForWI, this_max_context, dryRun);
|
const { worldInfoString, worldInfoBefore, worldInfoAfter, worldInfoExamples, worldInfoDepth } = await getWorldInfoPrompt(chatForWI, this_max_context, dryRun);
|
||||||
setExtensionPrompt('QUIET_PROMPT', '', extension_prompt_types.IN_PROMPT, 0, true);
|
setExtensionPrompt('QUIET_PROMPT', '', extension_prompt_types.IN_PROMPT, 0, true);
|
||||||
|
|
||||||
// Add message example WI
|
// Add message example WI
|
||||||
for (const example of worldInfoExamples) {
|
for (const example of worldInfoExamples) {
|
||||||
let exampleMessage = example.content;
|
const exampleMessage = example.content;
|
||||||
|
|
||||||
if (exampleMessage.length === 0) {
|
if (exampleMessage.length === 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let formattedExample = baseChatReplace(exampleMessage, name1, name2);
|
const formattedExample = baseChatReplace(exampleMessage, name1, name2);
|
||||||
const cleanedExample = parseMesExamples(formattedExample);
|
const cleanedExample = parseMesExamples(formattedExample);
|
||||||
|
|
||||||
// Insert depending on before or after position
|
// Insert depending on before or after position
|
||||||
|
Reference in New Issue
Block a user