Chat Completion: split "none" and "default" names behavior
This commit is contained in:
parent
de38b06eec
commit
d31e44dec8
|
@ -1660,16 +1660,24 @@
|
|||
</div>
|
||||
<div class="inline-drawer-content">
|
||||
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none">
|
||||
<input type="radio" id="character_names_none" name="character_names" value="0">
|
||||
<input type="radio" id="character_names_none" name="character_names" value="-1">
|
||||
<span data-i18n="None">None</span>
|
||||
<i class="right_menu_button fa-solid fa-circle-exclamation" title="Except for groups and past personas. Otherwise, make sure you provide names in the prompt." data-i18n="[title]character_names_none"></i>
|
||||
<small class="flexBasis100p" data-i18n="Don't add character names.">
|
||||
Don't add character names.
|
||||
<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="Never add character names.">
|
||||
Never add character names.
|
||||
</small>
|
||||
</label>
|
||||
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_default">
|
||||
<input type="radio" id="character_names_default" name="character_names" value="0">
|
||||
<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="Don't add character names unless necessary.">
|
||||
Don't add character names unless necessary.
|
||||
</small>
|
||||
</label>
|
||||
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_completion">
|
||||
<input type="radio" id="character_names_completion" name="character_names" value="1">
|
||||
<span data-i18n="Completion">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="Add character names to completion objects.">
|
||||
Add character names to completion objects.
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
"Character Names Behavior": "سلوك أسماء الشخصيات",
|
||||
"Helps the model to associate messages with characters.": "يساعد النموذج على ربط الرسائل بالأحرف.",
|
||||
"None": "لا شيء",
|
||||
"character_names_none": "باستثناء المجموعات والشخصيات السابقة. بخلاف ذلك، تأكد من تقديم الأسماء في المطالبة.",
|
||||
"character_names_default": "باستثناء المجموعات والشخصيات السابقة. بخلاف ذلك، تأكد من تقديم الأسماء في المطالبة.",
|
||||
"Don't add character names.": "لا تضيف أسماء الشخصيات.",
|
||||
"Completion": "كائن الإكمال",
|
||||
"character_names_completion": "تنطبق القيود: فقط الحروف الأبجدية اللاتينية والأرقام والشرطات السفلية. لا يعمل مع جميع المصادر، ولا سيما: Claude وMistralAI وGoogle.",
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
"Character Names Behavior": "Charakternamen Verhalten",
|
||||
"Helps the model to associate messages with characters.": "Hilft dem Modell, Nachrichten mit Zeichen zu verknüpfen.",
|
||||
"None": "Keins",
|
||||
"character_names_none": "Außer für Gruppen und frühere Personas. Andernfalls stellen Sie sicher, dass Sie in der Eingabeaufforderung Namen angeben.",
|
||||
"character_names_default": "Außer für Gruppen und frühere Personas. Andernfalls stellen Sie sicher, dass Sie in der Eingabeaufforderung Namen angeben.",
|
||||
"Don't add character names.": "Fügen Sie keine Charakternamen hinzu.",
|
||||
"Completion": "Vervollständigungsobjekt",
|
||||
"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 @@
|
|||
"Character Names Behavior": "Comportamiento de los nombres de personajes",
|
||||
"Helps the model to associate messages with characters.": "Ayuda al modelo a asociar mensajes con personajes.",
|
||||
"None": "Ninguno",
|
||||
"character_names_none": "Excepto grupos y personas pasadas. De lo contrario, asegúrese de proporcionar nombres en el mensaje.",
|
||||
"character_names_default": "Excepto grupos y personas pasadas. De lo contrario, asegúrese de proporcionar nombres en el mensaje.",
|
||||
"Don't add character names.": "No agregues nombres de personajes.",
|
||||
"Completion": "Objeto de finalización",
|
||||
"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 @@
|
|||
"Character Names Behavior": "Comportement des noms de personnages",
|
||||
"Helps the model to associate messages with characters.": "Aide le modèle à associer des messages à des personnages.",
|
||||
"None": "Aucun",
|
||||
"character_names_none": "Sauf pour les groupes et les personnages passés. Sinon, assurez-vous de fournir des noms dans l'invite.",
|
||||
"character_names_default": "Sauf pour les groupes et les personnages passés. Sinon, assurez-vous de fournir des noms dans l'invite.",
|
||||
"Don't add character names.": "N'ajoutez pas de noms de personnages.",
|
||||
"Completion": "Objet d'achèvement",
|
||||
"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 @@
|
|||
"Character Names Behavior": "Hegðun persónunafna",
|
||||
"Helps the model to associate messages with characters.": "Hjálpar líkaninu að tengja skilaboð við stafi.",
|
||||
"None": "Enginn",
|
||||
"character_names_none": "Nema hópar og fyrri persónur. Annars, vertu viss um að gefa upp nöfn í hvetjunni.",
|
||||
"character_names_default": "Nema hópar og fyrri persónur. Annars, vertu viss um að gefa upp nöfn í hvetjunni.",
|
||||
"Don't add character names.": "Ekki bæta við persónunöfnum.",
|
||||
"Completion": "Lokunarhlutur",
|
||||
"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 @@
|
|||
"Character Names Behavior": "Comportamento dei nomi dei personaggi",
|
||||
"Helps the model to associate messages with characters.": "Aiuta il modello ad associare i messaggi ai personaggi.",
|
||||
"None": "Nessuno",
|
||||
"character_names_none": "Fatta eccezione per i gruppi e i personaggi passati. Altrimenti, assicurati di fornire i nomi nel prompt.",
|
||||
"character_names_default": "Fatta eccezione per i gruppi e i personaggi passati. Altrimenti, assicurati di fornire i nomi nel prompt.",
|
||||
"Don't add character names.": "Non aggiungere nomi di personaggi.",
|
||||
"Completion": "Oggetto di completamento",
|
||||
"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 @@
|
|||
"Character Names Behavior": "キャラクター名の動作",
|
||||
"Helps the model to associate messages with characters.": "モデルがメッセージをキャラクターに関連付けるのに役立ちます。",
|
||||
"None": "なし",
|
||||
"character_names_none": "グループと過去のペルソナを除きます。それ以外の場合は、プロンプトに名前を必ず入力してください。",
|
||||
"character_names_default": "グループと過去のペルソナを除きます。それ以外の場合は、プロンプトに名前を必ず入力してください。",
|
||||
"Don't add character names.": "キャラクター名を追加しないでください。",
|
||||
"Completion": "完了オブジェクト",
|
||||
"character_names_completion": "制限事項: ラテン英数字とアンダースコアのみ。すべてのソースで機能するわけではありません。特に、Claude、MistralAI、Google では機能しません。",
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
"Character Names Behavior": "캐릭터 이름 행동",
|
||||
"Helps the model to associate messages with characters.": "모델이 메시지를 캐릭터와 연관시키는 데 도움이 됩니다.",
|
||||
"None": "없음",
|
||||
"character_names_none": "그룹 및 과거 페르소나는 제외됩니다. 그렇지 않으면 프롬프트에 이름을 제공해야 합니다.",
|
||||
"character_names_default": "그룹 및 과거 페르소나는 제외됩니다. 그렇지 않으면 프롬프트에 이름을 제공해야 합니다.",
|
||||
"Don't add character names.": "캐릭터 이름을 추가하지 마세요.",
|
||||
"Completion": "완료 객체",
|
||||
"character_names_completion": "제한 사항이 적용됩니다. 라틴 영숫자 및 밑줄만 사용할 수 있습니다. 모든 소스, 특히 Claude, MistralAI, Google에서 작동하지 않습니다.",
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
"Character Names Behavior": "Karakternamen Gedrag",
|
||||
"Helps the model to associate messages with characters.": "Helpt het model berichten aan karakters te koppelen.",
|
||||
"None": "Geen",
|
||||
"character_names_none": "Behalve voor groepen en vroegere persona's. Zorg er anders voor dat u namen opgeeft in de prompt.",
|
||||
"character_names_default": "Behalve voor groepen en vroegere persona's. Zorg er anders voor dat u namen opgeeft in de prompt.",
|
||||
"Don't add character names.": "Voeg geen namen van personages toe.",
|
||||
"Completion": "Voltooiingsobject",
|
||||
"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 @@
|
|||
"Character Names Behavior": "Comportamento dos nomes dos personagens",
|
||||
"Helps the model to associate messages with characters.": "Ajuda o modelo a associar mensagens a personagens.",
|
||||
"None": "Nenhum",
|
||||
"character_names_none": "Exceto para grupos e personas passadas. Caso contrário, certifique-se de fornecer nomes no prompt.",
|
||||
"character_names_default": "Exceto para grupos e personas passadas. Caso contrário, certifique-se de fornecer nomes no prompt.",
|
||||
"Don't add character names.": "Não adicione nomes de personagens.",
|
||||
"Completion": "Objeto de conclusão",
|
||||
"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 @@
|
|||
"Top P & Min P": "Top P & Min P",
|
||||
"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.",
|
||||
"Helps the model to associate messages with characters.": "Помогает модели связывать сообщения с персонажами.",
|
||||
"character_names_none": "Except for groups and past personas. Otherwise, make sure you provide names in the prompt.",
|
||||
"character_names_default": "Except for groups and past personas. Otherwise, make sure you provide names in the prompt.",
|
||||
"Completion": "Completion Object",
|
||||
"character_names_completion": "Только латинские буквы, цифры и знак подчёркивания. Работает не для всех бэкендов, в частности для Claude, MistralAI, Google.",
|
||||
"Use AI21 Tokenizer": "Использовать токенайзер AI21",
|
||||
|
@ -1662,4 +1662,4 @@
|
|||
"ext_regex_sts_desc": "Сообщения, отправленные с помощью команд STscript",
|
||||
"ext_regex_wi_desc": "Содержимое лорбуков и миров. Для работы требует включения флажка \"Только промпт\"!",
|
||||
"ext_regex_only_format_display_desc": "История чата не изменится, замена будет осуществляться только в отображаемом сообщении (в UI)"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
"Character Names Behavior": "Поведінка імен персонажів",
|
||||
"Helps the model to associate messages with characters.": "Допомагає моделі пов’язувати повідомлення з символами.",
|
||||
"None": "Немає",
|
||||
"character_names_none": "За винятком груп і минулих персонажів. В іншому випадку переконайтеся, що ви вказали імена в підказці.",
|
||||
"character_names_default": "За винятком груп і минулих персонажів. В іншому випадку переконайтеся, що ви вказали імена в підказці.",
|
||||
"Don't add character names.": "Не додавайте імена персонажів.",
|
||||
"Completion": "Об'єкт завершення",
|
||||
"character_names_completion": "Застосовуються обмеження: лише латинські букви та цифри підкреслення. Працює не для всіх джерел, зокрема: Claude, MistralAI, Google.",
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
"Character Names Behavior": "Tên nhân vật Hành vi",
|
||||
"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ự.",
|
||||
"None": "Không",
|
||||
"character_names_none": "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.",
|
||||
"character_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.",
|
||||
"Don't add character names.": "Không thêm tên nhân vật.",
|
||||
"Completion": "Đối tượng hoàn thành",
|
||||
"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 @@
|
|||
"Character Names Behavior": "角色名称行为",
|
||||
"Helps the model to associate messages with characters.": "有助于模型将消息与角色关联起来。",
|
||||
"None": "无",
|
||||
"character_names_none": "群聊和过去的角色除外。否则,请确保在提示词中提供了姓名。",
|
||||
"character_names_default": "群聊和过去的角色除外。否则,请确保在提示词中提供了姓名。",
|
||||
"Don't add character names.": "不添加角色名称。",
|
||||
"Completion": "补全对象",
|
||||
"character_names_completion": "适用限制:仅限拉丁字母数字和下划线。不适用于所有补全源,尤其是:Claude、MistralAI、Google。",
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
"Character Names Behavior": "角色人物名稱行為",
|
||||
"Helps the model to associate messages with characters.": "幫助模型將訊息與角色人物關聯起來。",
|
||||
"None": "無",
|
||||
"character_names_none": "除了團體和過去的玩家角色人物外。否則,請確保在提示中提供名字。",
|
||||
"character_names_default": "除了團體和過去的玩家角色人物外。否則,請確保在提示中提供名字。",
|
||||
"Don't add character names.": "不要新增角色人物名稱",
|
||||
"Completion": "補充",
|
||||
"character_names_completion": "字元限制:僅限拉丁字母數字和底線。不適用於所有來源,特別是:Claude、MistralAI、Google。",
|
||||
|
|
|
@ -188,7 +188,8 @@ export const chat_completion_sources = {
|
|||
};
|
||||
|
||||
const character_names_behavior = {
|
||||
NONE: 0,
|
||||
NONE: -1,
|
||||
DEFAULT: 0,
|
||||
COMPLETION: 1,
|
||||
CONTENT: 2,
|
||||
};
|
||||
|
@ -300,7 +301,7 @@ const default_settings = {
|
|||
bypass_status_check: false,
|
||||
continue_prefill: false,
|
||||
function_calling: false,
|
||||
names_behavior: character_names_behavior.NONE,
|
||||
names_behavior: character_names_behavior.DEFAULT,
|
||||
continue_postfix: continue_postfix_types.SPACE,
|
||||
custom_prompt_post_processing: custom_prompt_post_processing_types.NONE,
|
||||
seed: -1,
|
||||
|
@ -380,7 +381,7 @@ const oai_settings = {
|
|||
bypass_status_check: false,
|
||||
continue_prefill: false,
|
||||
function_calling: false,
|
||||
names_behavior: character_names_behavior.NONE,
|
||||
names_behavior: character_names_behavior.DEFAULT,
|
||||
continue_postfix: continue_postfix_types.SPACE,
|
||||
custom_prompt_post_processing: custom_prompt_post_processing_types.NONE,
|
||||
seed: -1,
|
||||
|
@ -554,6 +555,8 @@ function setOpenAIMessages(chat) {
|
|||
// for groups or sendas command - prepend a character's name
|
||||
switch (oai_settings.names_behavior) {
|
||||
case character_names_behavior.NONE:
|
||||
break;
|
||||
case character_names_behavior.DEFAULT:
|
||||
if (selected_group || (chat[j].force_avatar && chat[j].name !== name1 && chat[j].extra?.type !== system_message_types.NARRATOR)) {
|
||||
content = `${chat[j].name}: ${content}`;
|
||||
}
|
||||
|
@ -563,8 +566,9 @@ function setOpenAIMessages(chat) {
|
|||
content = `${chat[j].name}: ${content}`;
|
||||
}
|
||||
break;
|
||||
case character_names_behavior.COMPLETION:
|
||||
break;
|
||||
default:
|
||||
// No action for character_names_behavior.COMPLETION
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3189,6 +3193,9 @@ function setNamesBehaviorControls() {
|
|||
case character_names_behavior.NONE:
|
||||
$('#character_names_none').prop('checked', true);
|
||||
break;
|
||||
case character_names_behavior.DEFAULT:
|
||||
$('#character_names_default').prop('checked', true);
|
||||
break;
|
||||
case character_names_behavior.COMPLETION:
|
||||
$('#character_names_completion').prop('checked', true);
|
||||
break;
|
||||
|
@ -5184,6 +5191,12 @@ $(document).ready(async function () {
|
|||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
$('#character_names_default').on('input', function () {
|
||||
oai_settings.names_behavior = character_names_behavior.DEFAULT;
|
||||
setNamesBehaviorControls();
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
$('#character_names_completion').on('input', function () {
|
||||
oai_settings.names_behavior = character_names_behavior.COMPLETION;
|
||||
setNamesBehaviorControls();
|
||||
|
|
Loading…
Reference in New Issue