From 5df454640f2b7f3249d168cd3e246985ba3c2740 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Sun, 7 Apr 2024 01:57:59 +0200 Subject: [PATCH] Fix forced persona name not being added to examples --- public/scripts/instruct-mode.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/scripts/instruct-mode.js b/public/scripts/instruct-mode.js index 7fc924274..3167f3bb5 100644 --- a/public/scripts/instruct-mode.js +++ b/public/scripts/instruct-mode.js @@ -419,10 +419,13 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) { } for (const example of blockExamples) { + // If force group/persona names is set, we should override the include names for the user placeholder + const includeThisName = includeNames || (power_user.instruct.names_force_groups && example.name == 'example_user'); + const prefix = example.name == 'example_user' ? inputPrefix : outputPrefix; const suffix = example.name == 'example_user' ? inputSuffix : outputSuffix; const name = example.name == 'example_user' ? name1 : name2; - const messageContent = includeNames ? `${name}: ${example.content}` : example.content; + const messageContent = includeThisName ? `${name}: ${example.content}` : example.content; const formattedMessage = [prefix, messageContent + suffix].filter(x => x).join(separator); formattedExamples.push(formattedMessage); }