Impersonate with last_input_sequence (#5456)

This commit is contained in:
CasualAutopsy
2026-04-15 15:43:41 -04:00
committed by GitHub
parent 78628f7dbb
commit af7bd65f42
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -4387,7 +4387,7 @@
<small data-i18n="First User Prefix">First User Prefix</small>
<textarea id="instruct_first_input_sequence" data-macros class="text_pole textarea_compact autoSetHeight"></textarea>
</div>
<div class="flexAuto" title="Inserted before the last User's message." data-i18n="[title]instruct_last_input_sequence">
<div class="flexAuto" title="Inserted before the last User's message or as a last prompt line when generating an impersonation." data-i18n="[title]instruct_last_input_sequence">
<small data-i18n="Last User Prefix">Last User Prefix</small>
<textarea id="instruct_last_input_sequence" data-macros class="text_pole wide100p textarea_compact autoSetHeight"></textarea>
</div>
+1 -1
View File
@@ -4718,7 +4718,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
chat2[i] = formatMessageHistoryItem(coreChat[j], isInstruct, force_output_sequence.FIRST);
}
if (lastUserMessageIndex >= 0 && j === lastUserMessageIndex && isInstruct) {
if (lastUserMessageIndex >= 0 && j === lastUserMessageIndex && isInstruct && !isImpersonate) {
// Reformat with the last input sequence (if any)
chat2[i] = formatMessageHistoryItem(coreChat[j], isInstruct, force_output_sequence.LAST);
}
+1 -1
View File
@@ -597,7 +597,7 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1,
function getSequence() {
// User impersonation prompt
if (isImpersonate) {
return instruct.input_sequence;
return instruct.last_input_sequence || instruct.input_sequence;
}
// Neutral / system / quiet prompt