Persona: add None position, fix double insert on In-chat position

c3a253baf3b7d7405f9ef51b6c20ad996ffb8684

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

3 files changed, +5 -3Ignore whitespace
public/index.html+1 -0
@@ -4553,6 +4553,7 @@
45534553 <div data-newbie-hidden>
45544554 <label for="persona_description_position" data-i18n="Position:">Position:</label>
45554555 <select id="persona_description_position">
4556+ <option value="9" data-i18n="None (disabled)">None (disabled)</option>
45564557 <option value="0" data-i18n="In Story String / Prompt Manager">In Story String / Prompt Manager</option>
45574558 <option value="2" data-i18n="Top of Author's Note">Top of Author's Note</option>
45584559 <option value="3" data-i18n="Bottom of Author's Note">Bottom of Author's Note</option>
public/script.js+3 -3
@@ -2705,7 +2705,7 @@ function addPersonaDescriptionExtensionPrompt() {
27052705 const INJECT_TAG = 'PERSONA_DESCRIPTION';
27062706 setExtensionPrompt(INJECT_TAG, '', extension_prompt_types.IN_PROMPT, 0);
27072707
27082708 if (!power_user.persona_description || power_user.persona_description_position === persona_description_positions.NONE) {
27092709 return;
27102710 }
27112711
@@ -3726,7 +3726,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
37263726 const storyStringParams = {
37273727 description: description,
37283728 personality: personality,
3729- persona: persona,
3729+ persona: power_user.persona_description_position == persona_description_positions.IN_PROMPT ? persona : '',
37303730 scenario: scenario,
37313731 system: isInstruct ? system : '',
37323732 char: name2,
@@ -4302,7 +4302,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
43024302 padding: power_user.token_padding,
43034303 main_api: main_api,
43044304 instruction: isInstruct ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.instruct.system_prompt) : '',
43054305 userPersona: (power_user.persona_descriptionpersona_description_position == persona_description_positions.IN_PROMPT ? (persona || '') : ''),
43064306 };
43074307
43084308 //console.log(additionalPromptStuff);
public/scripts/power-user.js+1 -0
@@ -107,6 +107,7 @@ export const persona_description_positions = {
107107 TOP_AN: 2,
108108 BOTTOM_AN: 3,
109109 AT_DEPTH: 4,
110+ NONE: 9,
110111};
111112
112113let power_user = {