Fix TC sysprompt leaking into CC prompts

5b4d524bc07486f4c4578c302f7816361b77569b

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -1Showing whitespace changes
public/script.js+3 -1
@@ -3527,6 +3527,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
3527 jailbreak,3527 jailbreak,
3528 } = getCharacterCardFields();3528 } = getCharacterCardFields();
35293529
3530 if (main_api !== 'openai') {
3530 if (power_user.sysprompt.enabled) {3531 if (power_user.sysprompt.enabled) {
3531 system = power_user.prefer_character_prompt && system ? system : baseChatReplace(power_user.sysprompt.content, name1, name2);3532 system = power_user.prefer_character_prompt && system ? system : baseChatReplace(power_user.sysprompt.content, name1, name2);
3532 system = isInstruct ? formatInstructModeSystemPrompt(substituteParams(system, name1, name2, power_user.sysprompt.content)) : system;3533 system = isInstruct ? formatInstructModeSystemPrompt(substituteParams(system, name1, name2, power_user.sysprompt.content)) : system;
@@ -3534,6 +3535,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
3534 // Nullify if it's not enabled3535 // Nullify if it's not enabled
3535 system = '';3536 system = '';
3536 }3537 }
3538 }
35373539
3538 // Depth prompt (character-specific A/N)3540 // Depth prompt (character-specific A/N)
3539 removeDepthPrompts();3541 removeDepthPrompts();
@@ -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 };