| 4214 | ? substituteParams(jailbreak, name1, name2, (power_user.sysprompt.post_history ?? '')) | 4214 | ? substituteParams(jailbreak, name1, name2, (power_user.sysprompt.post_history ?? '')) |
| 4215 | : baseChatReplace(power_user.sysprompt.post_history, name1, name2); | 4215 | : baseChatReplace(power_user.sysprompt.post_history, name1, name2); |
| 4216 | | 4216 | |
| 4217 | // When continuing generation of previous output, last user message precedes the message to continue | 4217 | // Only inject the jb if there is one |
| 4218 | if (isContinue) { | 4218 | if (jailbreak) { |
| 4219 | coreChat.splice(coreChat.length - 1, 0, { mes: jailbreak, is_user: true }); | 4219 | // When continuing generation of previous output, last user message precedes the message to continue |
| 4220 | } | 4220 | if (isContinue) { |
| 4221 | else { | 4221 | coreChat.splice(coreChat.length - 1, 0, { mes: jailbreak, is_user: true }); |
| 4222 | coreChat.push({ mes: jailbreak, is_user: true }); | 4222 | } |
| | 4223 | else { |
| | 4224 | coreChat.push({ mes: jailbreak, is_user: true }); |
| | 4225 | } |
| 4223 | } | 4226 | } |
| 4224 | } | 4227 | } |
| 4225 | | 4228 | |