Merge branch 'staging' into swipe-nums-for-all-mes
| @@ -1709,9 +1709,9 @@ | ||
| 1709 | 1709 | <div class=""> |
| 1710 | 1710 | <div class="inline-drawer wide100p flexFlowColumn"> |
| 1711 | 1711 | <div class="inline-drawer-toggle inline-drawer-header"> |
| 1712 | 1712 | <div class="flex-container alignItemsCenter flexNoGap"> |
| 1713 | 1713 | <b data-i18n="Character Names Behavior">Character Names Behavior</b> |
| 1714 | 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-spanopacity50p fa-solid fa-circle-questioninfo"></span> |
| 1715 | 1715 | <small class="flexBasis100p">(<span id="character_names_display"></span>)</small> |
| 1716 | 1716 | </div> |
| 1717 | 1717 | <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> |
| @@ -1720,25 +1720,22 @@ | ||
| 1720 | 1720 | <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none"> |
| 1721 | 1721 | <input type="radio" id="character_names_none" name="character_names" value="-1"> |
| 1722 | 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 | 1725 | </small> |
| 1727 | 1726 | </label> |
| 1728 | 1727 | <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_default"> |
| 1729 | 1728 | <input type="radio" id="character_names_default" name="character_names" value="0"> |
| 1730 | 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 | 1732 | </small> |
| 1735 | 1733 | </label> |
| 1736 | 1734 | <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_completion"> |
| 1737 | 1735 | <input type="radio" id="character_names_completion" name="character_names" value="1"> |
| 1738 | 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 | 1739 | </small> |
| 1743 | 1740 | </label> |
| 1744 | 1741 | <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_content"> |
| @@ -1754,9 +1751,9 @@ | ||
| 1754 | 1751 | </div> |
| 1755 | 1752 | <div class="inline-drawer wide100p flexFlowColumn marginBot10"> |
| 1756 | 1753 | <div class="inline-drawer-toggle inline-drawer-header"> |
| 1757 | 1754 | <div class="flex-container alignItemsCenter flexNoGap"> |
| 1758 | 1755 | <b data-i18n="Continue Postfix">Continue Postfix</b> |
| 1759 | 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="note-link-spanopacity50p fa-solid fa-circle-questioninfo"></span> |
| 1760 | 1757 | <small class="flexBasis100p">(<span id="continue_postfix_display"></span>)</small> |
| 1761 | 1758 | </div> |
| 1762 | 1759 | <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> |
| @@ -724,6 +724,12 @@ async function populateChatHistory(messages, prompts, chatCompletion, type = nul | ||
| 724 | 724 | |
| 725 | 725 | if (chatCompletion.canAfford(chatMessage)) { |
| 726 | 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 | 733 | const collection = new MessageCollection('continuePrefill', chatMessage); |
| 728 | 734 | chatCompletion.add(collection, -1); |
| 729 | 735 | continue; |
| @@ -1770,8 +1776,8 @@ async function sendOpenAIRequest(type, messages, signal) { | ||
| 1770 | 1776 | generate_data['claude_use_sysprompt'] = oai_settings.claude_use_sysprompt; |
| 1771 | 1777 | generate_data['stop'] = getCustomStoppingStrings(); // Claude shouldn't have limits on stop strings. |
| 1772 | 1778 | generate_data['human_sysprompt_message'] = substituteParams(oai_settings.human_sysprompt_message); |
| 1773 | 1779 | // Don't add a prefill on quiet gens (summarization) and when using continue prefill. |
| 1774 | 1780 | if (!isQuiet && !(isContinue && oai_settings.continue_prefill)) { |
| 1775 | 1781 | generate_data['assistant_prefill'] = isImpersonate ? substituteParams(oai_settings.assistant_impersonation) : substituteParams(oai_settings.assistant_prefill); |
| 1776 | 1782 | } |
| 1777 | 1783 | } |