mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Persona: add None position, fix double insert on In-chat position
This commit is contained in:
@ -4553,6 +4553,7 @@
|
|||||||
<div data-newbie-hidden>
|
<div data-newbie-hidden>
|
||||||
<label for="persona_description_position" data-i18n="Position:">Position:</label>
|
<label for="persona_description_position" data-i18n="Position:">Position:</label>
|
||||||
<select id="persona_description_position">
|
<select id="persona_description_position">
|
||||||
|
<option value="9" data-i18n="None (disabled)">None (disabled)</option>
|
||||||
<option value="0" data-i18n="In Story String / Prompt Manager">In Story String / Prompt Manager</option>
|
<option value="0" data-i18n="In Story String / Prompt Manager">In Story String / Prompt Manager</option>
|
||||||
<option value="2" data-i18n="Top of Author's Note">Top of Author's Note</option>
|
<option value="2" data-i18n="Top of Author's Note">Top of Author's Note</option>
|
||||||
<option value="3" data-i18n="Bottom of Author's Note">Bottom of Author's Note</option>
|
<option value="3" data-i18n="Bottom of Author's Note">Bottom of Author's Note</option>
|
||||||
|
@ -2705,7 +2705,7 @@ function addPersonaDescriptionExtensionPrompt() {
|
|||||||
const INJECT_TAG = 'PERSONA_DESCRIPTION';
|
const INJECT_TAG = 'PERSONA_DESCRIPTION';
|
||||||
setExtensionPrompt(INJECT_TAG, '', extension_prompt_types.IN_PROMPT, 0);
|
setExtensionPrompt(INJECT_TAG, '', extension_prompt_types.IN_PROMPT, 0);
|
||||||
|
|
||||||
if (!power_user.persona_description) {
|
if (!power_user.persona_description || power_user.persona_description_position === persona_description_positions.NONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3726,7 +3726,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
|||||||
const storyStringParams = {
|
const storyStringParams = {
|
||||||
description: description,
|
description: description,
|
||||||
personality: personality,
|
personality: personality,
|
||||||
persona: persona,
|
persona: power_user.persona_description_position == persona_description_positions.IN_PROMPT ? persona : '',
|
||||||
scenario: scenario,
|
scenario: scenario,
|
||||||
system: isInstruct ? system : '',
|
system: isInstruct ? system : '',
|
||||||
char: name2,
|
char: name2,
|
||||||
@ -4302,7 +4302,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
|||||||
padding: power_user.token_padding,
|
padding: power_user.token_padding,
|
||||||
main_api: main_api,
|
main_api: main_api,
|
||||||
instruction: isInstruct ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.instruct.system_prompt) : '',
|
instruction: isInstruct ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.instruct.system_prompt) : '',
|
||||||
userPersona: (power_user.persona_description || ''),
|
userPersona: (power_user.persona_description_position == persona_description_positions.IN_PROMPT ? (persona || '') : ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
//console.log(additionalPromptStuff);
|
//console.log(additionalPromptStuff);
|
||||||
|
@ -107,6 +107,7 @@ export const persona_description_positions = {
|
|||||||
TOP_AN: 2,
|
TOP_AN: 2,
|
||||||
BOTTOM_AN: 3,
|
BOTTOM_AN: 3,
|
||||||
AT_DEPTH: 4,
|
AT_DEPTH: 4,
|
||||||
|
NONE: 9,
|
||||||
};
|
};
|
||||||
|
|
||||||
let power_user = {
|
let power_user = {
|
||||||
|
Reference in New Issue
Block a user