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

d3120afc6039814e989a4e4a93cf78bf7b651f04

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

2 files changed, +18 -15Showing whitespace changes
public/index.html+10 -13
@@ -1709,9 +1709,9 @@
1709 <div class="">1709 <div class="">
1710 <div class="inline-drawer wide100p flexFlowColumn">1710 <div class="inline-drawer wide100p flexFlowColumn">
1711 <div class="inline-drawer-toggle inline-drawer-header">1711 <div class="inline-drawer-toggle inline-drawer-header">
1712 <div class="flex-container alignItemsCenter flexNoGap">1712 <div class="flex-container alignItemsCenter">
1713 <b data-i18n="Character Names Behavior">Character Names Behavior</b>1713 <b data-i18n="Character Names Behavior">Character Names Behavior</b>
1714 <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>1714 <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>
1715 <small class="flexBasis100p">(<span id="character_names_display"></span>)</small>1715 <small class="flexBasis100p">(<span id="character_names_display"></span>)</small>
1716 </div>1716 </div>
1717 <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>1717 <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
@@ -1720,25 +1720,22 @@
1720 <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none">1720 <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none">
1721 <input type="radio" id="character_names_none" name="character_names" value="-1">1721 <input type="radio" id="character_names_none" name="character_names" value="-1">
1722 <span data-i18n="None">None</span>1722 <span data-i18n="None">None</span>
1723 <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>1723 <small class="flexBasis100p" data-i18n="character_names_none">
1724 <small class="flexBasis100p" data-i18n="Never add character names.">1724 Never add character name prefixes. May behave poorly in groups, choose with caution.
1725 Never add character names.
1726 </small>1725 </small>
1727 </label>1726 </label>
1728 <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_default">1727 <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_default">
1729 <input type="radio" id="character_names_default" name="character_names" value="0">1728 <input type="radio" id="character_names_default" name="character_names" value="0">
1730 <span data-i18n="Default">Default</span>1729 <span data-i18n="Default">Default</span>
1731 <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>1730 <small class="flexBasis100p" data-i18n="character_names_default">
1732 <small class="flexBasis100p" data-i18n="Don't add character names unless necessary.">1731 Add prefixes for groups and past personas. Otherwise, make sure you provide names in the prompt.
1733 Don't add character names unless necessary.
1734 </small>1732 </small>
1735 </label>1733 </label>
1736 <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_completion">1734 <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_completion">
1737 <input type="radio" id="character_names_completion" name="character_names" value="1">1735 <input type="radio" id="character_names_completion" name="character_names" value="1">
1738 <span data-i18n="Completion Object">Completion Object</span>1736 <span data-i18n="Completion Object">Completion Object</span>
1739 <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>1737 <small class="flexBasis100p" data-i18n="character_names_completion">
1740 <small class="flexBasis100p" data-i18n="Add character names to completion objects.">1738 Add character names to completion objects. Restrictions apply: only Latin alphanumerics and underscores.
1741 Add character names to completion objects.
1742 </small>1739 </small>
1743 </label>1740 </label>
1744 <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_content">1741 <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_content">
@@ -1754,9 +1751,9 @@
1754 </div>1751 </div>
1755 <div class="inline-drawer wide100p flexFlowColumn marginBot10">1752 <div class="inline-drawer wide100p flexFlowColumn marginBot10">
1756 <div class="inline-drawer-toggle inline-drawer-header">1753 <div class="inline-drawer-toggle inline-drawer-header">
1757 <div class="flex-container alignItemsCenter flexNoGap">1754 <div class="flex-container alignItemsCenter">
1758 <b data-i18n="Continue Postfix">Continue Postfix</b>1755 <b data-i18n="Continue Postfix">Continue Postfix</b>
1759 <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>1756 <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>
1760 <small class="flexBasis100p">(<span id="continue_postfix_display"></span>)</small>1757 <small class="flexBasis100p">(<span id="continue_postfix_display"></span>)</small>
1761 </div>1758 </div>
1762 <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>1759 <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
public/scripts/openai.js+8 -2
@@ -724,6 +724,12 @@ async function populateChatHistory(messages, prompts, chatCompletion, type = nul
724724
725 if (chatCompletion.canAfford(chatMessage)) {725 if (chatCompletion.canAfford(chatMessage)) {
726 if (type === 'continue' && oai_settings.continue_prefill && chatPrompt === firstNonInjected) {726 if (type === 'continue' && oai_settings.continue_prefill && chatPrompt === firstNonInjected) {
727 // 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
728 if (chatPrompt.role === 'assistant') {
729 const collection = new MessageCollection('continuePrefill', new Message(chatMessage.role, substituteParams(oai_settings.assistant_prefill + '\n\n') + chatMessage.content, chatMessage.identifier));
730 chatCompletion.add(collection, -1);
731 continue;
732 }
727 const collection = new MessageCollection('continuePrefill', chatMessage);733 const collection = new MessageCollection('continuePrefill', chatMessage);
728 chatCompletion.add(collection, -1);734 chatCompletion.add(collection, -1);
729 continue;735 continue;
@@ -1770,8 +1776,8 @@ async function sendOpenAIRequest(type, messages, signal) {
1770 generate_data['claude_use_sysprompt'] = oai_settings.claude_use_sysprompt;1776 generate_data['claude_use_sysprompt'] = oai_settings.claude_use_sysprompt;
1771 generate_data['stop'] = getCustomStoppingStrings(); // Claude shouldn't have limits on stop strings.1777 generate_data['stop'] = getCustomStoppingStrings(); // Claude shouldn't have limits on stop strings.
1772 generate_data['human_sysprompt_message'] = substituteParams(oai_settings.human_sysprompt_message);1778 generate_data['human_sysprompt_message'] = substituteParams(oai_settings.human_sysprompt_message);
1773 // Don't add a prefill on quiet gens (summarization)1779 // Don't add a prefill on quiet gens (summarization) and when using continue prefill.
1774 if (!isQuiet) {1780 if (!isQuiet && !(isContinue && oai_settings.continue_prefill)) {
1775 generate_data['assistant_prefill'] = isImpersonate ? substituteParams(oai_settings.assistant_impersonation) : substituteParams(oai_settings.assistant_prefill);1781 generate_data['assistant_prefill'] = isImpersonate ? substituteParams(oai_settings.assistant_impersonation) : substituteParams(oai_settings.assistant_prefill);
1776 }1782 }
1777 }1783 }