Chat Completion: split "none" and "default" names behavior
| @@ -1660,16 +1660,24 @@ | ||
| 1660 | 1660 | </div> |
| 1661 | 1661 | <div class="inline-drawer-content"> |
| 1662 | 1662 | <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none"> |
| 1663 | 1663 | <input type="radio" id="character_names_none" name="character_names" value="0-1"> |
| 1664 | 1664 | <span data-i18n="None">None</span> |
| 1665 | 1665 | <i class="right_menu_button fa-solid fa-circle-exclamation" title="Except forNever groupsadd andcharacter pastname personasprefixes. Otherwise, makeMay surebehave youpoorly providein namesgroups, inchoose thewith promptcaution." data-i18n="[title]character_names_none"></i> |
| 1666 | 1666 | <small class="flexBasis100p" data-i18n="Don'tNever add character names."> |
| 1667 | 1667 | Don'tNever add character names. |
| 1668 | + </small> | |
| 1669 | + </label> | |
| 1670 | + <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_default"> | |
| 1671 | + <input type="radio" id="character_names_default" name="character_names" value="0"> | |
| 1672 | + <span data-i18n="Default">Default</span> | |
| 1673 | + <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> | |
| 1674 | + <small class="flexBasis100p" data-i18n="Don't add character names unless necessary."> | |
| 1675 | + Don't add character names unless necessary. | |
| 1668 | 1676 | </small> |
| 1669 | 1677 | </label> |
| 1670 | 1678 | <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_completion"> |
| 1671 | 1679 | <input type="radio" id="character_names_completion" name="character_names" value="1"> |
| 1672 | 1680 | <span data-i18n="Completion Object">Completion Object</span> |
| 1673 | 1681 | <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> |
| 1674 | 1682 | <small class="flexBasis100p" data-i18n="Add character names to completion objects."> |
| 1675 | 1683 | Add character names to completion objects. |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "سلوك أسماء الشخصيات", |
| 217 | 217 | "Helps the model to associate messages with characters.": "يساعد النموذج على ربط الرسائل بالأحرف.", |
| 218 | 218 | "None": "لا شيء", |
| 219 | 219 | "character_names_nonecharacter_names_default": "باستثناء المجموعات والشخصيات السابقة. بخلاف ذلك، تأكد من تقديم الأسماء في المطالبة.", |
| 220 | 220 | "Don't add character names.": "لا تضيف أسماء الشخصيات.", |
| 221 | 221 | "Completion": "كائن الإكمال", |
| 222 | 222 | "character_names_completion": "تنطبق القيود: فقط الحروف الأبجدية اللاتينية والأرقام والشرطات السفلية. لا يعمل مع جميع المصادر، ولا سيما: Claude وMistralAI وGoogle.", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "Charakternamen Verhalten", |
| 217 | 217 | "Helps the model to associate messages with characters.": "Hilft dem Modell, Nachrichten mit Zeichen zu verknüpfen.", |
| 218 | 218 | "None": "Keins", |
| 219 | 219 | "character_names_nonecharacter_names_default": "Außer für Gruppen und frühere Personas. Andernfalls stellen Sie sicher, dass Sie in der Eingabeaufforderung Namen angeben.", |
| 220 | 220 | "Don't add character names.": "Fügen Sie keine Charakternamen hinzu.", |
| 221 | 221 | "Completion": "Vervollständigungsobjekt", |
| 222 | 222 | "character_names_completion": "Es gelten Einschränkungen: nur lateinische alphanumerische Zeichen und Unterstriche. Funktioniert nicht für alle Quellen, insbesondere: Claude, MistralAI, Google.", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "Comportamiento de los nombres de personajes", |
| 217 | 217 | "Helps the model to associate messages with characters.": "Ayuda al modelo a asociar mensajes con personajes.", |
| 218 | 218 | "None": "Ninguno", |
| 219 | 219 | "character_names_nonecharacter_names_default": "Excepto grupos y personas pasadas. De lo contrario, asegúrese de proporcionar nombres en el mensaje.", |
| 220 | 220 | "Don't add character names.": "No agregues nombres de personajes.", |
| 221 | 221 | "Completion": "Objeto de finalización", |
| 222 | 222 | "character_names_completion": "Aplican restricciones: solo caracteres alfanuméricos latinos y guiones bajos. No funciona para todas las fuentes, en particular: Claude, MistralAI, Google.", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "Comportement des noms de personnages", |
| 217 | 217 | "Helps the model to associate messages with characters.": "Aide le modèle à associer des messages à des personnages.", |
| 218 | 218 | "None": "Aucun", |
| 219 | 219 | "character_names_nonecharacter_names_default": "Sauf pour les groupes et les personnages passés. Sinon, assurez-vous de fournir des noms dans l'invite.", |
| 220 | 220 | "Don't add character names.": "N'ajoutez pas de noms de personnages.", |
| 221 | 221 | "Completion": "Objet d'achèvement", |
| 222 | 222 | "character_names_completion": "Des restrictions s'appliquent : uniquement les caractères alphanumériques latins et les traits de soulignement. Ne fonctionne pas pour toutes les sources, notamment : Claude, MistralAI, Google.", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "Hegðun persónunafna", |
| 217 | 217 | "Helps the model to associate messages with characters.": "Hjálpar líkaninu að tengja skilaboð við stafi.", |
| 218 | 218 | "None": "Enginn", |
| 219 | 219 | "character_names_nonecharacter_names_default": "Nema hópar og fyrri persónur. Annars, vertu viss um að gefa upp nöfn í hvetjunni.", |
| 220 | 220 | "Don't add character names.": "Ekki bæta við persónunöfnum.", |
| 221 | 221 | "Completion": "Lokunarhlutur", |
| 222 | 222 | "character_names_completion": "Takmarkanir gilda: aðeins latneskar tölustafir og undirstrik. Virkar ekki fyrir allar heimildir, sérstaklega: Claude, MistralAI, Google.", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "Comportamento dei nomi dei personaggi", |
| 217 | 217 | "Helps the model to associate messages with characters.": "Aiuta il modello ad associare i messaggi ai personaggi.", |
| 218 | 218 | "None": "Nessuno", |
| 219 | 219 | "character_names_nonecharacter_names_default": "Fatta eccezione per i gruppi e i personaggi passati. Altrimenti, assicurati di fornire i nomi nel prompt.", |
| 220 | 220 | "Don't add character names.": "Non aggiungere nomi di personaggi.", |
| 221 | 221 | "Completion": "Oggetto di completamento", |
| 222 | 222 | "character_names_completion": "Si applicano restrizioni: solo caratteri alfanumerici latini e trattini bassi. Non funziona con tutte le fonti, in particolare: Claude, MistralAI, Google.", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "キャラクター名の動作", |
| 217 | 217 | "Helps the model to associate messages with characters.": "モデルがメッセージをキャラクターに関連付けるのに役立ちます。", |
| 218 | 218 | "None": "なし", |
| 219 | 219 | "character_names_nonecharacter_names_default": "グループと過去のペルソナを除きます。それ以外の場合は、プロンプトに名前を必ず入力してください。", |
| 220 | 220 | "Don't add character names.": "キャラクター名を追加しないでください。", |
| 221 | 221 | "Completion": "完了オブジェクト", |
| 222 | 222 | "character_names_completion": "制限事項: ラテン英数字とアンダースコアのみ。すべてのソースで機能するわけではありません。特に、Claude、MistralAI、Google では機能しません。", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "캐릭터 이름 행동", |
| 217 | 217 | "Helps the model to associate messages with characters.": "모델이 메시지를 캐릭터와 연관시키는 데 도움이 됩니다.", |
| 218 | 218 | "None": "없음", |
| 219 | 219 | "character_names_nonecharacter_names_default": "그룹 및 과거 페르소나는 제외됩니다. 그렇지 않으면 프롬프트에 이름을 제공해야 합니다.", |
| 220 | 220 | "Don't add character names.": "캐릭터 이름을 추가하지 마세요.", |
| 221 | 221 | "Completion": "완료 객체", |
| 222 | 222 | "character_names_completion": "제한 사항이 적용됩니다. 라틴 영숫자 및 밑줄만 사용할 수 있습니다. 모든 소스, 특히 Claude, MistralAI, Google에서 작동하지 않습니다.", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "Karakternamen Gedrag", |
| 217 | 217 | "Helps the model to associate messages with characters.": "Helpt het model berichten aan karakters te koppelen.", |
| 218 | 218 | "None": "Geen", |
| 219 | 219 | "character_names_nonecharacter_names_default": "Behalve voor groepen en vroegere persona's. Zorg er anders voor dat u namen opgeeft in de prompt.", |
| 220 | 220 | "Don't add character names.": "Voeg geen namen van personages toe.", |
| 221 | 221 | "Completion": "Voltooiingsobject", |
| 222 | 222 | "character_names_completion": "Er zijn beperkingen van toepassing: alleen Latijnse alfanumerieke tekens en onderstrepingstekens. Werkt niet voor alle bronnen, met name: Claude, MistralAI, Google.", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "Comportamento dos nomes dos personagens", |
| 217 | 217 | "Helps the model to associate messages with characters.": "Ajuda o modelo a associar mensagens a personagens.", |
| 218 | 218 | "None": "Nenhum", |
| 219 | 219 | "character_names_nonecharacter_names_default": "Exceto para grupos e personas passadas. Caso contrário, certifique-se de fornecer nomes no prompt.", |
| 220 | 220 | "Don't add character names.": "Não adicione nomes de personagens.", |
| 221 | 221 | "Completion": "Objeto de conclusão", |
| 222 | 222 | "character_names_completion": "Aplicam-se restrições: apenas alfanuméricos latinos e sublinhados. Não funciona para todas as fontes, nomeadamente: Claude, MistralAI, Google.", |
| @@ -1246,7 +1246,7 @@ | ||
| 1246 | 1246 | "Top P & Min P": "Top P & Min P", |
| 1247 | 1247 | "llama.cpp only. Determines the order of samplers. If Mirostat mode is not 0, sampler order is ignored.": "llama.cpp only. Determines the order of samplers. If Mirostat mode is not 0, sampler order is ignored.", |
| 1248 | 1248 | "Helps the model to associate messages with characters.": "Помогает модели связывать сообщения с персонажами.", |
| 1249 | 1249 | "character_names_nonecharacter_names_default": "Except for groups and past personas. Otherwise, make sure you provide names in the prompt.", |
| 1250 | 1250 | "Completion": "Completion Object", |
| 1251 | 1251 | "character_names_completion": "Только латинские буквы, цифры и знак подчёркивания. Работает не для всех бэкендов, в частности для Claude, MistralAI, Google.", |
| 1252 | 1252 | "Use AI21 Tokenizer": "Использовать токенайзер AI21", |
| @@ -1662,4 +1662,4 @@ | ||
| 1662 | 1662 | "ext_regex_sts_desc": "Сообщения, отправленные с помощью команд STscript", |
| 1663 | 1663 | "ext_regex_wi_desc": "Содержимое лорбуков и миров. Для работы требует включения флажка \"Только промпт\"!", |
| 1664 | 1664 | "ext_regex_only_format_display_desc": "История чата не изменится, замена будет осуществляться только в отображаемом сообщении (в UI)" |
| 1665 | -} | |
| 1665 | \ No newline at end of file | |
| 1665 | +} | |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "Поведінка імен персонажів", |
| 217 | 217 | "Helps the model to associate messages with characters.": "Допомагає моделі пов’язувати повідомлення з символами.", |
| 218 | 218 | "None": "Немає", |
| 219 | 219 | "character_names_nonecharacter_names_default": "За винятком груп і минулих персонажів. В іншому випадку переконайтеся, що ви вказали імена в підказці.", |
| 220 | 220 | "Don't add character names.": "Не додавайте імена персонажів.", |
| 221 | 221 | "Completion": "Об'єкт завершення", |
| 222 | 222 | "character_names_completion": "Застосовуються обмеження: лише латинські букви та цифри підкреслення. Працює не для всіх джерел, зокрема: Claude, MistralAI, Google.", |
| @@ -216,7 +216,7 @@ | ||
| 216 | 216 | "Character Names Behavior": "Tên nhân vật Hành vi", |
| 217 | 217 | "Helps the model to associate messages with characters.": "Giúp mô hình liên kết tin nhắn với các ký tự.", |
| 218 | 218 | "None": "Không", |
| 219 | 219 | "character_names_nonecharacter_names_default": "Ngoại trừ các nhóm và cá tính trong quá khứ. Nếu không, hãy đảm bảo bạn cung cấp tên trong lời nhắc.", |
| 220 | 220 | "Don't add character names.": "Không thêm tên nhân vật.", |
| 221 | 221 | "Completion": "Đối tượng hoàn thành", |
| 222 | 222 | "character_names_completion": "Áp dụng hạn chế: chỉ chữ và số Latinh và dấu gạch dưới. Không hoạt động với tất cả các nguồn, đặc biệt là: Claude, MistralAI, Google.", |
| @@ -217,7 +217,7 @@ | ||
| 217 | 217 | "Character Names Behavior": "角色名称行为", |
| 218 | 218 | "Helps the model to associate messages with characters.": "有助于模型将消息与角色关联起来。", |
| 219 | 219 | "None": "无", |
| 220 | 220 | "character_names_nonecharacter_names_default": "群聊和过去的角色除外。否则,请确保在提示词中提供了姓名。", |
| 221 | 221 | "Don't add character names.": "不添加角色名称。", |
| 222 | 222 | "Completion": "补全对象", |
| 223 | 223 | "character_names_completion": "适用限制:仅限拉丁字母数字和下划线。不适用于所有补全源,尤其是:Claude、MistralAI、Google。", |
| @@ -217,7 +217,7 @@ | ||
| 217 | 217 | "Character Names Behavior": "角色人物名稱行為", |
| 218 | 218 | "Helps the model to associate messages with characters.": "幫助模型將訊息與角色人物關聯起來。", |
| 219 | 219 | "None": "無", |
| 220 | 220 | "character_names_nonecharacter_names_default": "除了團體和過去的玩家角色人物外。否則,請確保在提示中提供名字。", |
| 221 | 221 | "Don't add character names.": "不要新增角色人物名稱", |
| 222 | 222 | "Completion": "補充", |
| 223 | 223 | "character_names_completion": "字元限制:僅限拉丁字母數字和底線。不適用於所有來源,特別是:Claude、MistralAI、Google。", |
| @@ -188,7 +188,8 @@ export const chat_completion_sources = { | ||
| 188 | 188 | }; |
| 189 | 189 | |
| 190 | 190 | const character_names_behavior = { |
| 191 | 191 | NONE: 0-1, |
| 192 | + DEFAULT: 0, | |
| 192 | 193 | COMPLETION: 1, |
| 193 | 194 | CONTENT: 2, |
| 194 | 195 | }; |
| @@ -300,7 +301,7 @@ const default_settings = { | ||
| 300 | 301 | bypass_status_check: false, |
| 301 | 302 | continue_prefill: false, |
| 302 | 303 | function_calling: false, |
| 303 | 304 | names_behavior: character_names_behavior.NONEDEFAULT, |
| 304 | 305 | continue_postfix: continue_postfix_types.SPACE, |
| 305 | 306 | custom_prompt_post_processing: custom_prompt_post_processing_types.NONE, |
| 306 | 307 | seed: -1, |
| @@ -380,7 +381,7 @@ const oai_settings = { | ||
| 380 | 381 | bypass_status_check: false, |
| 381 | 382 | continue_prefill: false, |
| 382 | 383 | function_calling: false, |
| 383 | 384 | names_behavior: character_names_behavior.NONEDEFAULT, |
| 384 | 385 | continue_postfix: continue_postfix_types.SPACE, |
| 385 | 386 | custom_prompt_post_processing: custom_prompt_post_processing_types.NONE, |
| 386 | 387 | seed: -1, |
| @@ -554,6 +555,8 @@ function setOpenAIMessages(chat) { | ||
| 554 | 555 | // for groups or sendas command - prepend a character's name |
| 555 | 556 | switch (oai_settings.names_behavior) { |
| 556 | 557 | case character_names_behavior.NONE: |
| 558 | + break; | |
| 559 | + case character_names_behavior.DEFAULT: | |
| 557 | 560 | if (selected_group || (chat[j].force_avatar && chat[j].name !== name1 && chat[j].extra?.type !== system_message_types.NARRATOR)) { |
| 558 | 561 | content = `${chat[j].name}: ${content}`; |
| 559 | 562 | } |
| @@ -563,8 +566,9 @@ function setOpenAIMessages(chat) { | ||
| 563 | 566 | content = `${chat[j].name}: ${content}`; |
| 564 | 567 | } |
| 565 | 568 | break; |
| 569 | + case character_names_behavior.COMPLETION: | |
| 570 | + break; | |
| 566 | 571 | default: |
| 567 | - // No action for character_names_behavior.COMPLETION | |
| 568 | 572 | break; |
| 569 | 573 | } |
| 570 | 574 | |
| @@ -3189,6 +3193,9 @@ function setNamesBehaviorControls() { | ||
| 3189 | 3193 | case character_names_behavior.NONE: |
| 3190 | 3194 | $('#character_names_none').prop('checked', true); |
| 3191 | 3195 | break; |
| 3196 | + case character_names_behavior.DEFAULT: | |
| 3197 | + $('#character_names_default').prop('checked', true); | |
| 3198 | + break; | |
| 3192 | 3199 | case character_names_behavior.COMPLETION: |
| 3193 | 3200 | $('#character_names_completion').prop('checked', true); |
| 3194 | 3201 | break; |
| @@ -5184,6 +5191,12 @@ $(document).ready(async function () { | ||
| 5184 | 5191 | saveSettingsDebounced(); |
| 5185 | 5192 | }); |
| 5186 | 5193 | |
| 5194 | + $('#character_names_default').on('input', function () { | |
| 5195 | + oai_settings.names_behavior = character_names_behavior.DEFAULT; | |
| 5196 | + setNamesBehaviorControls(); | |
| 5197 | + saveSettingsDebounced(); | |
| 5198 | + }); | |
| 5199 | + | |
| 5187 | 5200 | $('#character_names_completion').on('input', function () { |
| 5188 | 5201 | oai_settings.names_behavior = character_names_behavior.COMPLETION; |
| 5189 | 5202 | setNamesBehaviorControls(); |