mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix impersonation prompting
This commit is contained in:
@ -1995,7 +1995,8 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
|||||||
mesSendString += mesSend[j];
|
mesSendString += mesSend[j];
|
||||||
|
|
||||||
if (isInstruct && isBottom && tokens_already_generated === 0) {
|
if (isInstruct && isBottom && tokens_already_generated === 0) {
|
||||||
mesSendString += formatInstructModePrompt(isImpersonate);
|
const name = isImpersonate ? (is_pygmalion ? 'You' : name1) : name2;
|
||||||
|
mesSendString += formatInstructModePrompt(name, isImpersonate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isInstruct && isImpersonate && isBottom && tokens_already_generated === 0) {
|
if (!isInstruct && isImpersonate && isBottom && tokens_already_generated === 0) {
|
||||||
|
@ -641,10 +641,11 @@ export function formatInstructStoryString(story) {
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatInstructModePrompt(isImpersonate) {
|
export function formatInstructModePrompt(name, isImpersonate) {
|
||||||
|
const includeNames = power_user.instruct.names || !!selected_group;
|
||||||
const sequence = isImpersonate ? power_user.instruct.input_sequence : power_user.instruct.output_sequence;
|
const sequence = isImpersonate ? power_user.instruct.input_sequence : power_user.instruct.output_sequence;
|
||||||
const separator = power_user.instruct.wrap ? '\n' : '';
|
const separator = power_user.instruct.wrap ? '\n' : '';
|
||||||
const text = separator + sequence;
|
const text = includeNames ? (separator + sequence + separator + `${name}:`) : (separator + sequence);
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user