Replace {{name}} macros in instruct suffixes

974f142f24724c76a649196301e0af8178856980

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +5 -0Ignore whitespace
public/scripts/instruct-mode.js+5 -0
@@ -333,6 +333,9 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata
333333 if (power_user.instruct.macro) {
334334 prefix = substituteParams(prefix, name1, name2);
335335 prefix = prefix.replace(/{{name}}/gi, name || 'System');
336+
337+ suffix = substituteParams(suffix, name1, name2);
338+ suffix = suffix.replace(/{{name}}/gi, name || 'System');
336339 }
337340
338341 if (!suffix && power_user.instruct.wrap) {
@@ -398,6 +401,8 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) {
398401
399402 inputPrefix = inputPrefix.replace(/{{name}}/gi, name1);
400403 outputPrefix = outputPrefix.replace(/{{name}}/gi, name2);
404+ inputSuffix = inputSuffix.replace(/{{name}}/gi, name1);
405+ outputSuffix = outputSuffix.replace(/{{name}}/gi, name2);
401406
402407 if (!inputSuffix && power_user.instruct.wrap) {
403408 inputSuffix = '\n';