Persona: add None position, fix double insert on In-chat position
| @@ -4553,6 +4553,7 @@ | |||
| 4553 | <div data-newbie-hidden> | 4553 | <div data-newbie-hidden> |
| 4554 | <label for="persona_description_position" data-i18n="Position:">Position:</label> | 4554 | <label for="persona_description_position" data-i18n="Position:">Position:</label> |
| 4555 | <select id="persona_description_position"> | 4555 | <select id="persona_description_position"> |
| 4556 | <option value="9" data-i18n="None (disabled)">None (disabled)</option> | ||
| 4556 | <option value="0" data-i18n="In Story String / Prompt Manager">In Story String / Prompt Manager</option> | 4557 | <option value="0" data-i18n="In Story String / Prompt Manager">In Story String / Prompt Manager</option> |
| 4557 | <option value="2" data-i18n="Top of Author's Note">Top of Author's Note</option> | 4558 | <option value="2" data-i18n="Top of Author's Note">Top of Author's Note</option> |
| 4558 | <option value="3" data-i18n="Bottom of Author's Note">Bottom of Author's Note</option> | 4559 | <option value="3" data-i18n="Bottom of Author's Note">Bottom of Author's Note</option> |
| @@ -2705,7 +2705,7 @@ function addPersonaDescriptionExtensionPrompt() { | |||
| 2705 | const INJECT_TAG = 'PERSONA_DESCRIPTION'; | 2705 | const INJECT_TAG = 'PERSONA_DESCRIPTION'; |
| 2706 | setExtensionPrompt(INJECT_TAG, '', extension_prompt_types.IN_PROMPT, 0); | 2706 | setExtensionPrompt(INJECT_TAG, '', extension_prompt_types.IN_PROMPT, 0); |
| 2707 | 2707 | ||
| 2708 | if (!power_user.persona_description) { | 2708 | if (!power_user.persona_description || power_user.persona_description_position === persona_description_positions.NONE) { |
| 2709 | return; | 2709 | return; |
| 2710 | } | 2710 | } |
| 2711 | 2711 | ||
| @@ -3726,7 +3726,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | |||
| 3726 | const storyStringParams = { | 3726 | const storyStringParams = { |
| 3727 | description: description, | 3727 | description: description, |
| 3728 | personality: personality, | 3728 | personality: personality, |
| 3729 | persona: persona, | 3729 | persona: power_user.persona_description_position == persona_description_positions.IN_PROMPT ? persona : '', |
| 3730 | scenario: scenario, | 3730 | scenario: scenario, |
| 3731 | system: isInstruct ? system : '', | 3731 | system: isInstruct ? system : '', |
| 3732 | char: name2, | 3732 | char: name2, |
| @@ -4302,7 +4302,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | |||
| 4302 | padding: power_user.token_padding, | 4302 | padding: power_user.token_padding, |
| 4303 | main_api: main_api, | 4303 | main_api: main_api, |
| 4304 | instruction: isInstruct ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.instruct.system_prompt) : '', | 4304 | instruction: isInstruct ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.instruct.system_prompt) : '', |
| 4305 | userPersona: (power_user.persona_description || ''), | 4305 | userPersona: (power_user.persona_description_position == persona_description_positions.IN_PROMPT ? (persona || '') : ''), |
| 4306 | }; | 4306 | }; |
| 4307 | 4307 | ||
| 4308 | //console.log(additionalPromptStuff); | 4308 | //console.log(additionalPromptStuff); |
| @@ -107,6 +107,7 @@ export const persona_description_positions = { | |||
| 107 | TOP_AN: 2, | 107 | TOP_AN: 2, |
| 108 | BOTTOM_AN: 3, | 108 | BOTTOM_AN: 3, |
| 109 | AT_DEPTH: 4, | 109 | AT_DEPTH: 4, |
| 110 | NONE: 9, | ||
| 110 | }; | 111 | }; |
| 111 | 112 | ||
| 112 | let power_user = { | 113 | let power_user = { |