diff --git a/public/index.html b/public/index.html index e99d56eb6..0bff8d2dd 100644 --- a/public/index.html +++ b/public/index.html @@ -2788,7 +2788,7 @@
-

Prompt Overrides (For OpenAI/Claude APIs, and Instruct mode)

+

Prompt Overrides (For OpenAI/Claude APIs, Window/OpenRouter, Poe, and Instruct mode)

@@ -2801,7 +2801,7 @@

Jailbreak

- +
diff --git a/public/script.js b/public/script.js index b010557d0..37d3fb123 100644 --- a/public/script.js +++ b/public/script.js @@ -2126,8 +2126,8 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject, // Moved here to not overflow the Poe context with added prompt bits if (main_api == 'poe') { - allAnchors = appendPoeAnchors(type, allAnchors); - zeroDepthAnchor = appendPoeAnchors(type, zeroDepthAnchor); + allAnchors = appendPoeAnchors(type, allAnchors, jailbreakPrompt); + zeroDepthAnchor = appendPoeAnchors(type, zeroDepthAnchor, jailbreakPrompt); } // hack for regeneration of the first message @@ -2710,7 +2710,7 @@ export function getBiasStrings(textareaText, type) { if (type === 'swipe' && chat.length - 1 === i) { continue; } - if (mes && (mes.is_user || mes.is_system || mes.extra.type === system_message_types.NARRATOR)) { + if (mes && (mes.is_user || mes.is_system || mes.extra?.type === system_message_types.NARRATOR)) { if (mes.extra?.bias?.trim()?.length > 0) { promptBias = mes.extra.bias; } diff --git a/public/scripts/poe.js b/public/scripts/poe.js index cf0e97613..788f3ee32 100644 --- a/public/scripts/poe.js +++ b/public/scripts/poe.js @@ -8,7 +8,10 @@ import { eventSource, event_types, scrollChatToBottom, + name1, + name2, } from "../script.js"; +import { power_user } from "./power-user.js"; import { SECRET_KEYS, secret_state, @@ -186,13 +189,16 @@ function onBotChange() { saveSettingsDebounced(); } -export function appendPoeAnchors(type, prompt) { +export function appendPoeAnchors(type, prompt, jailbreakPrompt) { const isImpersonate = type === 'impersonate'; const isQuiet = type === 'quiet'; if (poe_settings.character_nudge && !isQuiet && !isImpersonate) { - let characterNudge = '\n' + substituteParams(poe_settings.character_nudge_message); - prompt += characterNudge; + if (power_user.prefer_character_jailbreak && jailbreakPrompt) { + prompt += '\n' + substituteParams(jailbreakPrompt, name1, name2, poe_settings.character_nudge_message); + } else { + prompt += '\n' + substituteParams(poe_settings.character_nudge_message); + } } if (poe_settings.impersonation_prompt && isImpersonate) {