Clean-up JB prompt of caret returns and dangling spaces

This commit is contained in:
Cohee1207 2023-07-22 16:50:34 +03:00
parent ef3c8a19fe
commit 01f1f67de3
1 changed files with 2 additions and 1 deletions

View File

@ -400,7 +400,8 @@ async function prepareOpenAIMessages({ systemPrompt, name2, storyString, worldIn
const jailbreak = power_user.prefer_character_jailbreak && jailbreakPrompt ? jailbreakPrompt : oai_settings.jailbreak_prompt;
if (oai_settings.jailbreak_system && jailbreak) {
const jailbreakMessage = { "role": "system", "content": substituteParams(jailbreak, name1, name2, oai_settings.jailbreak_prompt) };
const jbContent = substituteParams(jailbreak, name1, name2, oai_settings.jailbreak_prompt).replace(/\r/gm, '').trim();
const jailbreakMessage = { "role": "system", "content": jbContent };
openai_msgs.push(jailbreakMessage);
total_count += handler_instance.count([jailbreakMessage], true, 'jailbreak');