Merge branch 'staging' into swipe-nums-for-all-mes

This commit is contained in:
Cohee 2024-10-01 20:46:10 +03:00
commit d3120afc60
2 changed files with 18 additions and 15 deletions

View File

@ -1709,9 +1709,9 @@
<div class=""> <div class="">
<div class="inline-drawer wide100p flexFlowColumn"> <div class="inline-drawer wide100p flexFlowColumn">
<div class="inline-drawer-toggle inline-drawer-header"> <div class="inline-drawer-toggle inline-drawer-header">
<div class="flex-container alignItemsCenter flexNoGap"> <div class="flex-container alignItemsCenter">
<b data-i18n="Character Names Behavior">Character Names Behavior</b> <b data-i18n="Character Names Behavior">Character Names Behavior</b>
<span title="Helps the model to associate messages with characters." data-i18n="[title]Helps the model to associate messages with characters." class="note-link-span fa-solid fa-circle-question"></span> <span title="Helps the model to associate messages with characters." data-i18n="[title]Helps the model to associate messages with characters." class="opacity50p fa-solid fa-circle-info"></span>
<small class="flexBasis100p">(<span id="character_names_display"></span>)</small> <small class="flexBasis100p">(<span id="character_names_display"></span>)</small>
</div> </div>
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
@ -1720,25 +1720,22 @@
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none"> <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none">
<input type="radio" id="character_names_none" name="character_names" value="-1"> <input type="radio" id="character_names_none" name="character_names" value="-1">
<span data-i18n="None">None</span> <span data-i18n="None">None</span>
<i class="right_menu_button fa-solid fa-circle-exclamation" title="Never add character name prefixes. May behave poorly in groups, choose with caution." data-i18n="[title]character_names_none"></i> <small class="flexBasis100p" data-i18n="character_names_none">
<small class="flexBasis100p" data-i18n="Never add character names."> Never add character name prefixes. May behave poorly in groups, choose with caution.
Never add character names.
</small> </small>
</label> </label>
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_default"> <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_default">
<input type="radio" id="character_names_default" name="character_names" value="0"> <input type="radio" id="character_names_default" name="character_names" value="0">
<span data-i18n="Default">Default</span> <span data-i18n="Default">Default</span>
<i class="right_menu_button fa-solid fa-circle-exclamation" title="Add prefixes for groups and past personas. Otherwise, make sure you provide names in the prompt." data-i18n="[title]character_names_default"></i> <small class="flexBasis100p" data-i18n="character_names_default">
<small class="flexBasis100p" data-i18n="Don't add character names unless necessary."> Add prefixes for groups and past personas. Otherwise, make sure you provide names in the prompt.
Don't add character names unless necessary.
</small> </small>
</label> </label>
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_completion"> <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_completion">
<input type="radio" id="character_names_completion" name="character_names" value="1"> <input type="radio" id="character_names_completion" name="character_names" value="1">
<span data-i18n="Completion Object">Completion Object</span> <span data-i18n="Completion Object">Completion Object</span>
<i class="right_menu_button fa-solid fa-circle-exclamation" title="Restrictions apply: only Latin alphanumerics and underscores. Doesn't work for all sources, notably: Claude, MistralAI, Google." data-i18n="[title]character_names_completion"></i> <small class="flexBasis100p" data-i18n="character_names_completion">
<small class="flexBasis100p" data-i18n="Add character names to completion objects."> Add character names to completion objects. Restrictions apply: only Latin alphanumerics and underscores.
Add character names to completion objects.
</small> </small>
</label> </label>
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_content"> <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_content">
@ -1754,9 +1751,9 @@
</div> </div>
<div class="inline-drawer wide100p flexFlowColumn marginBot10"> <div class="inline-drawer wide100p flexFlowColumn marginBot10">
<div class="inline-drawer-toggle inline-drawer-header"> <div class="inline-drawer-toggle inline-drawer-header">
<div class="flex-container alignItemsCenter flexNoGap"> <div class="flex-container alignItemsCenter">
<b data-i18n="Continue Postfix">Continue Postfix</b> <b data-i18n="Continue Postfix">Continue Postfix</b>
<span data-i18n="[title]The next chunk of the continued message will be appended using this as a separator." title="The next chunk of the continued message will be appended using this as a separator." class="note-link-span fa-solid fa-circle-question"></span> <span data-i18n="[title]The next chunk of the continued message will be appended using this as a separator." title="The next chunk of the continued message will be appended using this as a separator." class="opacity50p fa-solid fa-circle-info"></span>
<small class="flexBasis100p">(<span id="continue_postfix_display"></span>)</small> <small class="flexBasis100p">(<span id="continue_postfix_display"></span>)</small>
</div> </div>
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>

View File

@ -724,6 +724,12 @@ async function populateChatHistory(messages, prompts, chatCompletion, type = nul
if (chatCompletion.canAfford(chatMessage)) { if (chatCompletion.canAfford(chatMessage)) {
if (type === 'continue' && oai_settings.continue_prefill && chatPrompt === firstNonInjected) { if (type === 'continue' && oai_settings.continue_prefill && chatPrompt === firstNonInjected) {
// in case we are using continue_prefill and the latest message is an assistant message, we want to prepend the users assistant prefill on the message
if (chatPrompt.role === 'assistant') {
const collection = new MessageCollection('continuePrefill', new Message(chatMessage.role, substituteParams(oai_settings.assistant_prefill + '\n\n') + chatMessage.content, chatMessage.identifier));
chatCompletion.add(collection, -1);
continue;
}
const collection = new MessageCollection('continuePrefill', chatMessage); const collection = new MessageCollection('continuePrefill', chatMessage);
chatCompletion.add(collection, -1); chatCompletion.add(collection, -1);
continue; continue;
@ -1770,8 +1776,8 @@ async function sendOpenAIRequest(type, messages, signal) {
generate_data['claude_use_sysprompt'] = oai_settings.claude_use_sysprompt; generate_data['claude_use_sysprompt'] = oai_settings.claude_use_sysprompt;
generate_data['stop'] = getCustomStoppingStrings(); // Claude shouldn't have limits on stop strings. generate_data['stop'] = getCustomStoppingStrings(); // Claude shouldn't have limits on stop strings.
generate_data['human_sysprompt_message'] = substituteParams(oai_settings.human_sysprompt_message); generate_data['human_sysprompt_message'] = substituteParams(oai_settings.human_sysprompt_message);
// Don't add a prefill on quiet gens (summarization) // Don't add a prefill on quiet gens (summarization) and when using continue prefill.
if (!isQuiet) { if (!isQuiet && !(isContinue && oai_settings.continue_prefill)) {
generate_data['assistant_prefill'] = isImpersonate ? substituteParams(oai_settings.assistant_impersonation) : substituteParams(oai_settings.assistant_prefill); generate_data['assistant_prefill'] = isImpersonate ? substituteParams(oai_settings.assistant_impersonation) : substituteParams(oai_settings.assistant_prefill);
} }
} }