Option to disable name forcing for instruct groups and personas

This commit is contained in:
Cohee
2023-08-08 17:11:38 +03:00
parent 5f97a52d58
commit 5ba7588838
2 changed files with 13 additions and 2 deletions

View File

@ -1846,7 +1846,7 @@
<span data-i18n="Trim Incomplete Sentences">Trim Incomplete Sentences</span>
</label>
<!-- Add margin since this is a child of above -->
<label style="margin-left: 1em;" class="checkbox_label" for="include_newline_checkbox">
<label class="checkbox_label indent20p" for="include_newline_checkbox">
<input id="include_newline_checkbox" type="checkbox" />
<span data-i18n="Include Newline">Include Newline</span>
</label>
@ -1890,6 +1890,10 @@
<input id="instruct_names" type="checkbox" />
<span data-i18n="Include Names">Include Names</span>
</label>
<label for="instruct_names_force_groups" class="checkbox_label indent20p">
<input id="instruct_names_force_groups" type="checkbox" />
<span data-i18n="Force for Groups and Personas">Force for Groups and Personas</span>
</label>
</div>
<label for="instruct_presets">
<span data-i18n="Presets">Presets</span>

View File

@ -177,6 +177,7 @@ let power_user = {
preset: 'Alpaca',
separator_sequence: '',
macro: false,
names_force_groups: true,
},
personas: {},
@ -853,6 +854,7 @@ function loadInstructMode() {
{ id: "instruct_stop_sequence", property: "stop_sequence", isCheckbox: false },
{ id: "instruct_names", property: "names", isCheckbox: true },
{ id: "instruct_macro", property: "macro", isCheckbox: true },
{ id: "instruct_names_force_groups", property: "names_force_groups", isCheckbox: true },
];
controls.forEach(control => {
@ -929,7 +931,12 @@ export function fuzzySearchCharacters(searchValue) {
}
export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvatar, name1, name2) {
const includeNames = isNarrator ? false : (power_user.instruct.names || !!selected_group || !!forceAvatar);
let includeNames = isNarrator ? false : power_user.instruct.names;
if (!isNarrator && power_user.instruct.names_force_groups && (selected_group || forceAvatar)) {
includeNames = true;
}
let sequence = (isUser || isNarrator) ? power_user.instruct.input_sequence : power_user.instruct.output_sequence;
if (power_user.instruct.macro) {