mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
don't inject empty jb
This commit is contained in:
@ -4214,6 +4214,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
|||||||
? substituteParams(jailbreak, name1, name2, (power_user.sysprompt.post_history ?? ''))
|
? substituteParams(jailbreak, name1, name2, (power_user.sysprompt.post_history ?? ''))
|
||||||
: baseChatReplace(power_user.sysprompt.post_history, name1, name2);
|
: baseChatReplace(power_user.sysprompt.post_history, name1, name2);
|
||||||
|
|
||||||
|
// Only inject the jb if there is one
|
||||||
|
if (jailbreak && typeof(jailbreak) != 'undefined') {
|
||||||
// When continuing generation of previous output, last user message precedes the message to continue
|
// When continuing generation of previous output, last user message precedes the message to continue
|
||||||
if (isContinue) {
|
if (isContinue) {
|
||||||
coreChat.splice(coreChat.length - 1, 0, { mes: jailbreak, is_user: true });
|
coreChat.splice(coreChat.length - 1, 0, { mes: jailbreak, is_user: true });
|
||||||
@ -4222,6 +4224,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
|||||||
coreChat.push({ mes: jailbreak, is_user: true });
|
coreChat.push({ mes: jailbreak, is_user: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let chat2 = [];
|
let chat2 = [];
|
||||||
let continue_mag = '';
|
let continue_mag = '';
|
||||||
|
Reference in New Issue
Block a user