From 974f142f24724c76a649196301e0af8178856980 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 13 Jul 2024 00:16:31 +0300 Subject: [PATCH] Replace {{name}} macros in instruct suffixes --- public/scripts/instruct-mode.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/scripts/instruct-mode.js b/public/scripts/instruct-mode.js index 862237cf6..497774315 100644 --- a/public/scripts/instruct-mode.js +++ b/public/scripts/instruct-mode.js @@ -333,6 +333,9 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata if (power_user.instruct.macro) { prefix = substituteParams(prefix, name1, name2); prefix = prefix.replace(/{{name}}/gi, name || 'System'); + + suffix = substituteParams(suffix, name1, name2); + suffix = suffix.replace(/{{name}}/gi, name || 'System'); } if (!suffix && power_user.instruct.wrap) { @@ -398,6 +401,8 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) { inputPrefix = inputPrefix.replace(/{{name}}/gi, name1); outputPrefix = outputPrefix.replace(/{{name}}/gi, name2); + inputSuffix = inputSuffix.replace(/{{name}}/gi, name1); + outputSuffix = outputSuffix.replace(/{{name}}/gi, name2); if (!inputSuffix && power_user.instruct.wrap) { inputSuffix = '\n';