mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-20 21:41:32 +01:00
Replace {{name}} macros in instruct suffixes
This commit is contained in:
parent
2232a4fbd7
commit
974f142f24
@ -333,6 +333,9 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata
|
|||||||
if (power_user.instruct.macro) {
|
if (power_user.instruct.macro) {
|
||||||
prefix = substituteParams(prefix, name1, name2);
|
prefix = substituteParams(prefix, name1, name2);
|
||||||
prefix = prefix.replace(/{{name}}/gi, name || 'System');
|
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) {
|
if (!suffix && power_user.instruct.wrap) {
|
||||||
@ -398,6 +401,8 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) {
|
|||||||
|
|
||||||
inputPrefix = inputPrefix.replace(/{{name}}/gi, name1);
|
inputPrefix = inputPrefix.replace(/{{name}}/gi, name1);
|
||||||
outputPrefix = outputPrefix.replace(/{{name}}/gi, name2);
|
outputPrefix = outputPrefix.replace(/{{name}}/gi, name2);
|
||||||
|
inputSuffix = inputSuffix.replace(/{{name}}/gi, name1);
|
||||||
|
outputSuffix = outputSuffix.replace(/{{name}}/gi, name2);
|
||||||
|
|
||||||
if (!inputSuffix && power_user.instruct.wrap) {
|
if (!inputSuffix && power_user.instruct.wrap) {
|
||||||
inputSuffix = '\n';
|
inputSuffix = '\n';
|
||||||
|
Loading…
Reference in New Issue
Block a user