Fix TC sysprompt leaking into CC prompts
| @@ -3527,12 +3527,14 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | |||
| 3527 | jailbreak, | 3527 | jailbreak, |
| 3528 | } = getCharacterCardFields(); | 3528 | } = getCharacterCardFields(); |
| 3529 | 3529 | ||
| 3530 | if (power_user.sysprompt.enabled) { | 3530 | if (main_api !== 'openai') { |
| 3531 | system = power_user.prefer_character_prompt && system ? system : baseChatReplace(power_user.sysprompt.content, name1, name2); | 3531 | if (power_user.sysprompt.enabled) { |
| 3532 | system = isInstruct ? formatInstructModeSystemPrompt(substituteParams(system, name1, name2, power_user.sysprompt.content)) : system; | 3532 | system = power_user.prefer_character_prompt && system ? system : baseChatReplace(power_user.sysprompt.content, name1, name2); |
| 3533 | } else { | 3533 | system = isInstruct ? formatInstructModeSystemPrompt(substituteParams(system, name1, name2, power_user.sysprompt.content)) : system; |
| 3534 | // Nullify if it's not enabled | 3534 | } else { |
| 3535 | system = ''; | 3535 | // Nullify if it's not enabled |
| 3536 | system = ''; | ||
| 3537 | } | ||
| 3536 | } | 3538 | } |
| 3537 | 3539 | ||
| 3538 | // Depth prompt (character-specific A/N) | 3540 | // Depth prompt (character-specific A/N) |
| @@ -4359,7 +4361,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | |||
| 4359 | this_max_context: this_max_context, | 4361 | this_max_context: this_max_context, |
| 4360 | padding: power_user.token_padding, | 4362 | padding: power_user.token_padding, |
| 4361 | main_api: main_api, | 4363 | main_api: main_api, |
| 4362 | instruction: power_user.sysprompt.enabled ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.sysprompt.content) : '', | 4364 | instruction: main_api !== 'openai' && power_user.sysprompt.enabled ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.sysprompt.content) : '', |
| 4363 | userPersona: (power_user.persona_description_position == persona_description_positions.IN_PROMPT ? (persona || '') : ''), | 4365 | userPersona: (power_user.persona_description_position == persona_description_positions.IN_PROMPT ? (persona || '') : ''), |
| 4364 | tokenizer: getFriendlyTokenizerName(main_api).tokenizerName || '', | 4366 | tokenizer: getFriendlyTokenizerName(main_api).tokenizerName || '', |
| 4365 | }; | 4367 | }; |