Chat Completion: Reduce number of toggles in AI Response Configuration (#4821) * Chat Completion: Reduce number of toggles in AI Response Configuration * Consolidate migration logic * Don't enable media inlining if image inlining was disabled * Fix icons showing on media toggle off * Update i18n

0a22856faf26c399e0919b226a0cff83f0c18bcf

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

Signed
23 files changed, +99 -235Showing whitespace changes
default/content/presets/openai/Default.json+2 -4
@@ -28,7 +28,6 @@
2828 "repetition_penalty": 1,
2929 "openai_max_context": 4095,
3030 "openai_max_tokens": 300,
31- "wrap_in_quotes": false,
3231 "names_behavior": 0,
3332 "send_if_empty": "",
3433 "impersonation_prompt": "[Write your next reply from the point of view of {{user}}, using the chat history so far as a guideline for the writing style of {{user}}. Don't write as {{char}} or system. Don't describe actions of {{char}}.]",
@@ -231,9 +230,8 @@
231230 "show_external_models": false,
232231 "assistant_prefill": "",
233232 "assistant_impersonation": "",
234233 "claude_use_syspromptuse_sysprompt": false,
235234 "squash_system_messagesmedia_inlining": falsetrue,
236- "image_inlining": false,
237235 "bypass_status_check": false,
238236 "continue_prefill": false,
239237 "continue_postfix": " ",
default/content/settings.json+0 -1
@@ -463,7 +463,6 @@
463463 "stream_openai": true,
464464 "openai_max_context": 4095,
465465 "openai_max_tokens": 300,
466- "wrap_in_quotes": false,
467466 "prompts": [
468467 {
469468 "name": "Main Prompt",
public/css/toggle-dependent.css+1 -0
@@ -532,6 +532,7 @@ label[for="bind_preset_to_connection"]:has(input:checked) {
532532}
533533
534534#openai_settings input[type="checkbox"]:not(:checked)~[data-cc-toggle],
535+#openai_settings input[type="checkbox"]:not(:checked)~*:has([data-cc-toggle]),
535536#openai_settings [data-cc-toggle="false"]>.icon-supported,
536537#openai_settings [data-cc-toggle="true"]>.icon-unsupported {
537538 display: none;
public/index.html+28 -79
@@ -1920,18 +1920,6 @@
19201920 </div>
19211921 </div>
19221922 <div class="range-block">
1923- <label for="wrap_in_quotes" title="Wrap user messages in quotes before sending" data-i18n="[title]Wrap user messages in quotes before sending" class="checkbox_label widthFreeExpand">
1924- <input id="wrap_in_quotes" type="checkbox" /><span data-i18n="Wrap in Quotes">
1925- Wrap in Quotes</span>
1926- </label>
1927- <div class="toggle-description justifyLeft">
1928- <span data-i18n="Wrap entire user message in quotes before sending.">Wrap
1929- entire user message in quotes before sending.</span><br>
1930- <span data-i18n="Leave off if you use quotes manually for speech.">Leave off
1931- if you use quotes manually for speech.</span>
1932- </div>
1933- </div>
1934- <div class="range-block">
19351923 <label for="continue_prefill" class="checkbox_label widthFreeExpand">
19361924 <input id="continue_prefill" type="checkbox" />
19371925 <span data-i18n="Continue prefill">Continue prefill</span>
@@ -1942,16 +1930,16 @@
19421930 </span>
19431931 </div>
19441932 </div>
19451933 <div class="range-block" data-source="claude,makersuite,vertexai">
19461934 <label for="squash_system_messages" title="Squash system messages" data-i18n="[title]Squash system messagesuse_sysprompt" class="checkbox_label widthFreeExpand">
19471935 <input id="squash_system_messagesuse_sysprompt" type="checkbox" />
1948- <span data-i18n="Squash system messages">
1936+ <span>
1949- Squash system messages
1937+ <span data-i18n="Use system prompt">Use system prompt</span>
19501938 </span>
19511939 </label>
19521940 <div class="toggle-description justifyLeft marginBot5">
19531941 <span data-i18n="CombinesSend consecutivethe system messagesprompt intofor onesupported (excludingmodels. exampleIf dialogues).disabled, Maythe improveuser coherencemessage foris someadded modelsto the beginning of the prompt.">
1954- Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.
1942+ Send the system prompt for supported models. If disabled, the user message is added to the beginning of the prompt.
19551943 </span>
19561944 </div>
19571945 </div>
@@ -1985,16 +1973,28 @@
19851973 </div>
19861974 </div>
19871975 <div class="range-block" data-source="openai,aimlapi,openrouter,mistralai,makersuite,vertexai,claude,custom,xai,pollinations,moonshot,cohere,cometapi,nanogpt,electronhub,azure_openai,zai,siliconflow">
19881976 <label for="openai_image_inliningopenai_media_inlining" class="checkbox_label flexWrap widthFreeExpand">
19891977 <input id="openai_image_inliningopenai_media_inlining" type="checkbox" />
19901978 <span data-i18n="Send inline imagesmedia">Send inline imagesmedia</span>
19911979 <div idclass="openai_image_inlining_supported" data-ccflex-toggle="falsecontainer">
1992- <i class="icon-supported fa-solid fa-circle-check" title="Supported by the current model" data-i18n="[title]Supported by the current model"></i>
1980+ <div id="openai_image_inlining_supported">
19931981 <i class="icon-unsupportedsupported fa-solid fa-circle-exclamationimage" title="UnsupportedSupported by the current model" data-i18n="[title]UnsupportedSupported by the current model"></i>
1982+ <i class="icon-unsupported fa-solid fa-image" title="Unsupported by the current model" data-i18n="[title]Unsupported by the current model"></i>
1983+ </div>
1984+ <div id="openai_video_inlining_supported" data-source="makersuite,vertexai,openrouter">
1985+ <i class="icon-supported fa-solid fa-film" title="Supported by the current model" data-i18n="[title]Supported by the current model"></i>
1986+ <i class="icon-unsupported fa-solid fa-film" title="Unsupported by the current model" data-i18n="[title]Unsupported by the current model"></i>
1987+ </div>
1988+ <div id="openai_audio_inlining_supported" data-source="makersuite,vertexai,openrouter">
1989+ <i class="icon-supported fa-solid fa-music" title="Supported by the current model" data-i18n="[title]Supported by the current model"></i>
1990+ <i class="icon-unsupported fa-solid fa-music" title="Unsupported by the current model" data-i18n="[title]Unsupported by the current model"></i>
1991+ </div>
19941992 </div>
19951993 </label>
19961994 <div id="image_inlining_hint" class="flexBasis100p toggle-description justifyLeft">
19971995 <span data-i18n="image_inlining_hint_1">Sends imagesattached media in prompts if thesupported modelby supportsthe itmodel.</span>
1996+ <strong data-source="makersuite,vertexai" data-i18n="video_inlining_hint_4">Videos must be less than 20 MB and under 1 minute long.</strong>
1997+ <strong data-source="makersuite,vertexai" data-i18n="audio_inlining_hint_2">Audio must be less than 20 MB.</strong>
19981998 </div>
19991999 <div class="flex-container flexFlowColumn wide100p textAlignCenter marginTop10" data-source="openai,custom,xai,pollinations,cohere,cometapi,nanogpt,moonshot,aimlapi,openrouter,mistralai,electronhub,azure_openai,zai,siliconflow">
20002000 <div class="flex-container oneline-dropdown">
@@ -2009,40 +2009,12 @@
20092009 </div>
20102010 </div>
20112011 </div>
2012- <div class="range-block" data-source="makersuite,vertexai,openrouter">
2013- <label for="openai_video_inlining" class="checkbox_label flexWrap widthFreeExpand">
2014- <input id="openai_video_inlining" type="checkbox" />
2015- <span data-i18n="Send inline videos">Send inline videos</span>
2016- <div id="openai_video_inlining_supported" data-cc-toggle="false">
2017- <i class="icon-supported fa-solid fa-circle-check" title="Supported by the current model" data-i18n="[title]Supported by the current model"></i>
2018- <i class="icon-unsupported fa-solid fa-circle-exclamation" title="Unsupported by the current model" data-i18n="[title]Unsupported by the current model"></i>
2019- </div>
2020- </label>
2021- <div id="video_inlining_hint" class="flexBasis100p toggle-description justifyLeft">
2022- <span data-i18n="video_inlining_hint_1">Sends videos in prompts if the model supports it.</span>
2023- <strong data-source="makersuite,vertexai" data-i18n="video_inlining_hint_4">Videos must be less than 20 MB and under 1 minute long</strong>
2024- </div>
2025- </div>
2026- <div class="range-block" data-source="makersuite,vertexai,openrouter">
2027- <label for="openai_audio_inlining" class="checkbox_label flexWrap widthFreeExpand">
2028- <input id="openai_audio_inlining" type="checkbox" />
2029- <span data-i18n="Send inline audio">Send inline audio</span>
2030- <div id="openai_audio_inlining_supported" data-cc-toggle="false">
2031- <i class="icon-supported fa-solid fa-circle-check" title="Supported by the current model" data-i18n="[title]Supported by the current model"></i>
2032- <i class="icon-unsupported fa-solid fa-circle-exclamation" title="Unsupported by the current model" data-i18n="[title]Unsupported by the current model"></i>
2033- </div>
2034- </label>
2035- <div id="audio_inlining_hint" class="flexBasis100p toggle-description justifyLeft">
2036- <span data-i18n="audio_inlining_hint_1">Sends audio in prompts if the model supports it.</span>
2037- <strong data-source="makersuite,vertexai" data-i18n="audio_inlining_hint_2">Audio must be less than 20 MB</strong>
2038- </div>
2039- </div>
20402012 <div class="range-block" data-source="makersuite,vertexai">
20412013 <label for="openai_request_images" class="checkbox_label widthFreeExpand">
20422014 <input id="openai_request_images" type="checkbox" />
20432015 <span>
20442016 <span data-i18n="Request inline images">Request inline images</span>
20452017 <i class="opacity50p fa-solid fa-circle-info" title="Gemini 2.05 Flash ExperimentalImage / Gemini 3 Pro Image"></i>
20462018 </span>
20472019 </label>
20482020 <div class="toggle-description justifyLeft marginBot5">
@@ -2054,20 +2026,6 @@
20542026 </em>
20552027 </div>
20562028 </div>
2057- <div class="range-block" data-source="makersuite,vertexai">
2058- <label for="use_makersuite_sysprompt" class="checkbox_label widthFreeExpand">
2059- <input id="use_makersuite_sysprompt" type="checkbox" />
2060- <span>
2061- <span data-i18n="Use system prompt">Use system prompt</span>
2062- <i class="opacity50p fa-solid fa-circle-info" title="Gemini 1.5+, LearnLM"></i>
2063- </span>
2064- </label>
2065- <div class="toggle-description justifyLeft marginBot5">
2066- <span data-i18n="Merges_all_system_messages_desc_1">
2067- Merges all system messages up until the first message with a non-system role, and sends them in a</span> <code>system_instruction</code> <span data-i18n="Merges_all_system_messages_desc_2">field.
2068- </span>
2069- </div>
2070- </div>
20712029 <div class="range-block" data-source="deepseek,aimlapi,openrouter,custom,claude,xai,makersuite,vertexai,pollinations,moonshot,mistralai,fireworks,cometapi,electronhub,azure_openai,nanogpt,zai">
20722030 <label for="openai_show_thoughts" class="checkbox_label widthFreeExpand">
20732031 <input id="openai_show_thoughts" type="checkbox" />
@@ -2124,15 +2082,6 @@
21242082 <i class="fa-solid fa-circle-info"></i>
21252083 <span>Prefills won't work when function calling is enabled and any tools are registered.</span>
21262084 </div>
2127- <label for="claude_use_sysprompt" class="checkbox_label widthFreeExpand">
2128- <input id="claude_use_sysprompt" type="checkbox" />
2129- <span data-i18n="Use system prompt">Use system prompt</span>
2130- </label>
2131- <div class="toggle-description justifyLeft marginBot5">
2132- <span data-i18n="Send the system prompt for supported models. If disabled, the user message is added to the beginning of the prompt.">
2133- Send the system prompt for supported models. If disabled, the user message is added to the beginning of the prompt.
2134- </span>
2135- </div>
21362085 </div>
21372086 </div>
21382087 <div class="range-block m-t-1" data-source="openai,aimlapi,openrouter,custom,electronhub,azure_openai">
public/locales/ar-sa.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "يجمع الرسائل المتتالية للنظام في رسالة واحدة (باستثناء الحوارات المثالية). قد يحسن التتابع لبعض النماذج.",
236236 "Enable function calling": "تمكين استدعاء الوظيفة",
237237 "Send inline images": "إرسال الصور المضمنة",
238238 "image_inlining_hint_1": "يرسل الصورملفات الوسائط في المطالبات إذا كان النموذج يدعمها .",
239239 "image_inlining_hint_2": "الإجراء على أي رسالة أو",
240240 "image_inlining_hint_3": "القائمة لإرفاق ملف صورة للدردشة.",
241241 "Inline Image Quality": "جودة الصورة المضمنة",
public/locales/de-de.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "Kombiniert aufeinanderfolgende Systemnachrichten zu einer (ausschließlich Beispiel-Dialoge ausgeschlossen). Kann die Kohärenz für einige Modelle verbessern.",
236236 "Enable function calling": "Funktionsaufruf aktivieren",
237237 "Send inline images": "Inline-Bilder senden",
238238 "image_inlining_hint_1": "Sendet BilderMediendateien in Eingabeaufforderungen, wenn das Modell dies unterstützt.",
239239 "image_inlining_hint_2": "Aktion auf eine Nachricht oder die",
240240 "image_inlining_hint_3": "Menü, um eine Bilddatei an den Chat anzuhängen.",
241241 "Inline Image Quality": "Inline-Bildqualität",
public/locales/es-es.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "Combina mensajes del sistema consecutivos en uno solo (excluyendo diálogos de ejemplo). Puede mejorar la coherencia para algunos modelos.",
236236 "Enable function calling": "Habilitar llamada a función",
237237 "Send inline images": "Enviar imágenes en línea",
238238 "image_inlining_hint_1": "Envía imágenesarchivos multimedia en mensajes si el modelo lo admite.",
239239 "image_inlining_hint_2": "acción sobre cualquier mensaje o el",
240240 "image_inlining_hint_3": "menú para adjuntar un archivo de imagen al chat.",
241241 "Inline Image Quality": "Calidad de imagen en línea",
public/locales/fr-fr.json+1 -1
@@ -227,7 +227,7 @@
227227 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "Combine les messages système consécutifs en un seul (à l'exclusion des dialogues d'exemple). Peut améliorer la cohérence pour certains modèles.",
228228 "Enable function calling": "Activer l'appel de fonction",
229229 "Send inline images": "Envoyer des images en ligne",
230230 "image_inlining_hint_1": "Envoie des imagesfichiers multimédias dans les prompts si le modèle le prend en charge.",
231231 "image_inlining_hint_2": "action sur n'importe quel message ou le",
232232 "image_inlining_hint_3": "menu pour joindre un fichier image au chat.",
233233 "Inline Image Quality": "Qualité d'image en ligne",
public/locales/is-is.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "Sameinar samhliða kerfisskilaboð í eitt (sem er utan umsagna dæmum). Getur bætt samfelldni fyrir sumar módel.",
236236 "Enable function calling": "Virkja aðgerðarkall",
237237 "Send inline images": "Senda myndir í línu",
238238 "image_inlining_hint_1": "Sendir myndirmargmiðlunarskrár í skilaboðum ef líkanið styður það.",
239239 "image_inlining_hint_2": "aðgerð á hvaða skilaboðum sem er eða",
240240 "image_inlining_hint_3": "valmynd til að hengja myndskrá við spjallið.",
241241 "Inline Image Quality": "Innbyggð myndgæði",
public/locales/it-it.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "Combina i messaggi di sistema consecutivi in uno solo (escludendo i dialoghi di esempio). Potrebbe migliorare la coerenza per alcuni modelli.",
236236 "Enable function calling": "Abilita la chiamata alla funzione",
237237 "Send inline images": "Invia immagini inline",
238238 "image_inlining_hint_1": "Invia immaginifile multimediali nei prompt se il modello lo supporta.",
239239 "image_inlining_hint_2": "azione su qualsiasi messaggio o il",
240240 "image_inlining_hint_3": "menu per allegare un file immagine alla chat.",
241241 "Inline Image Quality": "Qualità dell'immagine in linea",
public/locales/ja-jp.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "連続するシステムメッセージを1つに結合します(例のダイアログを除く)。一部のモデルの一貫性を向上させる可能性があります。",
236236 "Enable function calling": "関数呼び出しを有効にする",
237237 "Send inline images": "インライン画像を送信",
238238 "image_inlining_hint_1": "モデルがサポートしている場合、プロンプトで画像を送信しますプロンプトでメディアファイルを送信します。",
239239 "image_inlining_hint_2": "メッセージに対するアクションまたは",
240240 "image_inlining_hint_3": "チャットに画像ファイルを添付するためのメニュー。",
241241 "Inline Image Quality": "インライン画像品質",
public/locales/ko-kr.json+1 -1
@@ -237,7 +237,7 @@
237237 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "연속된 시스템 메시지를 하나로 결합합니다(예제 대화 제외). 일부 모델의 일관성을 향상시킬 수 있습니다.",
238238 "Enable function calling": "함수 호출 활성화",
239239 "Send inline images": "인라인 이미지 전송",
240240 "image_inlining_hint_1": "모델이 지원하는 경우 메시지로 이미지를미디어 파일을 보냅니다.",
241241 "Inline Image Quality": "인라인 이미지 품질",
242242 "openai_inline_image_quality_auto": "자동",
243243 "openai_inline_image_quality_low": "낮은",
public/locales/nl-nl.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "Combineert opeenvolgende systeemberichten tot één (exclusief voorbeeld dialogen). Kan de coherentie verbeteren voor sommige modellen.",
236236 "Enable function calling": "Schakel functieaanroepen in",
237237 "Send inline images": "Inline afbeeldingen verzenden",
238238 "image_inlining_hint_1": "Verzendt afbeeldingenmediabestanden in prompts als het model dit ondersteunt.",
239239 "Inline Image Quality": "Inline-beeldkwaliteit",
240240 "openai_inline_image_quality_auto": "Auto",
241241 "openai_inline_image_quality_low": "Laag",
public/locales/pt-pt.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "Combina mensagens do sistema consecutivas em uma (excluindo diálogos de exemplo). Pode melhorar a coerência para alguns modelos.",
236236 "Enable function calling": "Habilitar chamada de função",
237237 "Send inline images": "Enviar imagens inline",
238238 "image_inlining_hint_1": "Envia imagensficheiros multimédia em prompts se o modelo suportar.",
239239 "Inline Image Quality": "Qualidade de imagem embutida",
240240 "openai_inline_image_quality_auto": "Auto",
241241 "openai_inline_image_quality_low": "Baixo",
public/locales/ru-ru.json+1 -2
@@ -1020,7 +1020,7 @@
10201020 "The prompt to be sent.": "Текст промпта.",
10211021 "prompt_manager_forbid_overrides": "Запретить перезапись",
10221022 "This prompt cannot be overridden by character cards, even if overrides are preferred.": "Карточка персонажа не сможет перезаписать этот промпт, даже если настройки отдают приоритет именно ей.",
10231023 "image_inlining_hint_1": "Отправлять картинкимедиафайлы как часть промпта, если позволяет модель.",
10241024 "Contest Winners": "Победители конкурса",
10251025 "Rename Background": "Переименовать фон",
10261026 "Lock": "Закрепить",
@@ -2443,7 +2443,6 @@
24432443 "Allocates a portion of the response length for thinking (min: 1024 tokens, low: 10%, medium: 25%, high: 50%, max: 95%), but minimum 1024 tokens. Auto does not request thinking.": "Отводит часть ответа под рассуждения (Минимальные: 10%, Обычные: 25%, Подробные: 50%, Максимальные: 95%), но минимум 1024 токена. При выборе значение Авто рассуждения не запрашиваются.",
24442444 "Use system prompt": "Включить системный промпт",
24452445 "Send inline videos": "Отправлять inline-видео",
2446- "video_inlining_hint_1": "Отправляет модели видео, если она поддерживает такую возможность.",
24472446 "video_inlining_hint_4": "Видео должно весить не более 20 Мб и длиться не дольше 1 минуты.",
24482447 "Allocates a portion of the response length for thinking (Flash 2.5/Pro 2.5) (min: 0/128 tokens, low: 10%, medium: 25%, high: 50%, max: 24576/32768 tokens). Auto lets the model decide.": "Отводит часть ответа под рассуждения (Flash 2.5/Pro 2.5) (Минимальные: 0/128 токенов, Поверхностные: 10%, Обычные: 25%, Подробные: 50%, Максимальные: 24576/32768 токенов). При выборе значения Авто модель определяет объём самостоятельно.",
24492448 "Google Vertex AI Configuration": "Настройки Google Vertex AI",
public/locales/th-th.json+1 -1
@@ -241,7 +241,7 @@
241241 "Allows the model to return its thinking process.": "อนุญาตให้โมเดลส่งคืนกระบวนการคิดของตัวเอง",
242242 "This setting affects visibility only.": "การตั้งค่านี้มีผลต่อการมองเห็นเท่านั้น",
243243 "Send inline images": "ส่งรูปภาพแบบ inline",
244244 "image_inlining_hint_1": "ส่งรูปภาพในพรอมตงไฟลสื่อในพรอมต์หากโมเดลรองรับ",
245245 "Inline Image Quality": "คุณภาพรูปภาพ Inline",
246246 "openai_inline_image_quality_auto": "อัตโนมัติ",
247247 "openai_inline_image_quality_low": "ต่ำ",
public/locales/uk-ua.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "Об'єднує послідовні системні повідомлення в одне (крім прикладів діалогів). Може покращити співпрацю для деяких моделей.",
236236 "Enable function calling": "Увімкнути виклик функцій",
237237 "Send inline images": "Надсилати вбудовані зображення",
238238 "image_inlining_hint_1": "Надсилає зображеннямедіафайли у підказках, якщо модель це підтримує.",
239239 "Inline Image Quality": "Якість вбудованого зображення",
240240 "openai_inline_image_quality_auto": "Авто",
241241 "openai_inline_image_quality_low": "Низький",
public/locales/vi-vn.json+1 -1
@@ -235,7 +235,7 @@
235235 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "Kết hợp các tin nhắn hệ thống liên tiếp thành một (loại bỏ các đoạn hội thoại mẫu). Có thể cải thiện tính nhất quán cho một số model.",
236236 "Enable function calling": "Sử dụng tính năng gọi hàm (function calling)",
237237 "Send inline images": "Gửi hình ảnh nội bộ",
238238 "image_inlining_hint_1": "Gửi hìnhtệp ảnhphương tiện theo Prompt nếu kiểu máy hỗ trợ.",
239239 "Inline Image Quality": "Chất lượng hình ảnh nội tuyến",
240240 "openai_inline_image_quality_auto": "Tự động",
241241 "openai_inline_image_quality_low": "Thấp",
public/locales/zh-cn.json+1 -2
@@ -269,13 +269,12 @@
269269 "enable_functions_desc_3": "可以被各种扩展利用来提供附加功能。",
270270 "enable_functions_desc_4": "当提示词后处理没有选择工具时不支持。",
271271 "Send inline images": "发送图片",
272272 "image_inlining_hint_1": "如果模型支持,就可以在提示词中发送图片就可以在提示词中发送媒体文件。",
273273 "Inline Image Quality": "图片画质",
274274 "openai_inline_image_quality_auto": "自动",
275275 "openai_inline_image_quality_low": "低",
276276 "openai_inline_image_quality_high": "高",
277277 "Send inline videos": "发送视频",
278- "video_inlining_hint_1": "当模型支持时,将视频发送给模型。",
279278 "video_inlining_hint_4": "视频必须在 20MB 以下且时长不超过1分钟。",
280279 "Request inline images": "请求图片返回",
281280 "Allows the model to return image attachments.": "允许模型返回图片附件。",
public/locales/zh-tw.json+1 -2
@@ -236,7 +236,7 @@
236236 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "將連續的系統訊息合併為一個(不包括對話範例)。可能會提高某些模型的一致性。",
237237 "Enable function calling": "啟用函式呼叫",
238238 "Send inline images": "傳送內嵌圖片",
239239 "image_inlining_hint_1": "如果模型支援,則在提示詞中傳送圖片則在提示詞中傳送媒體檔案。",
240240 "Inline Image Quality": "內嵌圖片品質",
241241 "openai_inline_image_quality_auto": "自動",
242242 "openai_inline_image_quality_low": "低",
@@ -2648,7 +2648,6 @@
26482648 "Min Keep": "最小保留",
26492649 "enable_functions_desc_4": "當使用「無工具」提示後處理時不支援!",
26502650 "Send inline videos": "傳送內嵌影片",
2651- "video_inlining_hint_1": "若模型支援,則在提示中傳送影片。",
26522651 "video_inlining_hint_4": "影片大小必須小於 20 MB 且長度低於 1 分鐘",
26532652 "This setting affects visibility only.": "此設定僅影響可見性。",
26542653 "Allocates a portion of the response length for thinking (min: 1024 tokens, low: 10%, medium: 25%, high: 50%, max: 95%), but minimum 1024 tokens. Auto does not request thinking.": "為推理部分分配回應長度(最大回應長度至少需 1024 符元,低:10%、中:25%、高:50%、最高:95%)。選擇「自動」將不請求推理。",
public/scripts/custom-request.js+1 -2
@@ -427,8 +427,7 @@ export class ChatCompletionService {
427427 reverse_proxy,
428428 proxy_password,
429429 custom_prompt_post_processing,
430430 use_makersuite_syspromptuse_sysprompt: true,
431- claude_use_sysprompt: true,
432431 ...props,
433432 };
434433
public/scripts/openai.js+49 -128
@@ -310,7 +310,6 @@ export const settingsToUpdate = {
310310 zai_endpoint: ['#zai_endpoint', 'zai_endpoint', false, true],
311311 openai_max_context: ['#openai_max_context', 'openai_max_context', false, false],
312312 openai_max_tokens: ['#openai_max_tokens', 'openai_max_tokens', false, false],
313- wrap_in_quotes: ['#wrap_in_quotes', 'wrap_in_quotes', true, false],
314313 names_behavior: ['#names_behavior', 'names_behavior', false, false],
315314 send_if_empty: ['#send_if_empty_textarea', 'send_if_empty', false, false],
316315 impersonation_prompt: ['#impersonation_prompt_textarea', 'impersonation_prompt', false, false],
@@ -331,16 +330,12 @@ export const settingsToUpdate = {
331330 proxy_password: ['#openai_proxy_password', 'proxy_password', false, true],
332331 assistant_prefill: ['#claude_assistant_prefill', 'assistant_prefill', false, false],
333332 assistant_impersonation: ['#claude_assistant_impersonation', 'assistant_impersonation', false, false],
334333 claude_use_syspromptuse_sysprompt: ['#claude_use_syspromptuse_sysprompt', 'claude_use_syspromptuse_sysprompt', true, false],
335- use_makersuite_sysprompt: ['#use_makersuite_sysprompt', 'use_makersuite_sysprompt', true, false],
336334 vertexai_auth_mode: ['#vertexai_auth_mode', 'vertexai_auth_mode', false, true],
337335 vertexai_region: ['#vertexai_region', 'vertexai_region', false, true],
338336 vertexai_express_project_id: ['#vertexai_express_project_id', 'vertexai_express_project_id', false, true],
339337 squash_system_messagesmedia_inlining: ['#squash_system_messagesopenai_media_inlining', 'squash_system_messagesmedia_inlining', true, false],
340- image_inlining: ['#openai_image_inlining', 'image_inlining', true, false],
341338 inline_image_quality: ['#openai_inline_image_quality', 'inline_image_quality', false, false],
342- video_inlining: ['#openai_video_inlining', 'video_inlining', true, false],
343- audio_inlining: ['#openai_audio_inlining', 'audio_inlining', true, false],
344339 continue_prefill: ['#continue_prefill', 'continue_prefill', true, false],
345340 continue_postfix: ['#continue_postfix', 'continue_postfix', false, false],
346341 function_calling: ['#openai_function_calling', 'function_calling', true, false],
@@ -371,7 +366,6 @@ const default_settings = {
371366 stream_openai: false,
372367 openai_max_context: max_4k,
373368 openai_max_tokens: 300,
374- wrap_in_quotes: false,
375369 ...chatCompletionDefaultPrompts,
376370 ...promptManagerDefaultPromptOrders,
377371 send_if_empty: '',
@@ -432,16 +426,12 @@ const default_settings = {
432426 proxy_password: '',
433427 assistant_prefill: '',
434428 assistant_impersonation: '',
435429 claude_use_syspromptuse_sysprompt: false,
436- use_makersuite_sysprompt: true,
437430 vertexai_auth_mode: 'express',
438431 vertexai_region: 'us-central1',
439432 vertexai_express_project_id: '',
440433 squash_system_messagesmedia_inlining: falsetrue,
441- image_inlining: true,
442434 inline_image_quality: 'auto',
443- video_inlining: true,
444- audio_inlining: true,
445435 bypass_status_check: false,
446436 continue_prefill: false,
447437 function_calling: false,
@@ -552,8 +542,6 @@ function setOpenAIMessages(chat) {
552542 // remove caret return (waste of tokens)
553543 content = content.replace(/\r/gm, '');
554544
555- // Apply the "wrap in quotes" option
556- if (role == 'user' && oai_settings.wrap_in_quotes) content = `"${content}"`;
557545 const name = chat[j]['name'];
558546 const media = chat[j]?.extra?.media;
559547 const mediaDisplay = getMediaDisplay(chat[j]);
@@ -1460,10 +1448,6 @@ export async function prepareOpenAIMessages({
14601448 // Pass chat completion to prompt manager for inspection
14611449 promptManager.setChatCompletion(chatCompletion);
14621450
1463- if (oai_settings.squash_system_messages && dryRun == false) {
1464- await chatCompletion.squashSystemMessages();
1465- }
1466-
14671451 // All information is up-to-date, render.
14681452 if (false === dryRun) promptManager.render(false);
14691453 }
@@ -2369,7 +2353,7 @@ async function sendOpenAIRequest(type, messages, signal, { jsonSchema = null } =
23692353
23702354 if (isClaude) {
23712355 generate_data['top_k'] = Number(oai_settings.top_k_openai);
23722356 generate_data['claude_use_syspromptuse_sysprompt'] = oai_settings.claude_use_syspromptuse_sysprompt;
23732357 generate_data['stop'] = getCustomStoppingStrings(); // Claude shouldn't have limits on stop strings.
23742358 // Don't add a prefill on quiet gens (summarization) and when using continue prefill.
23752359 if (!isQuiet && !(isContinue && oai_settings.continue_prefill)) {
@@ -2396,7 +2380,7 @@ async function sendOpenAIRequest(type, messages, signal, { jsonSchema = null } =
23962380 const stopStringsLimit = 5;
23972381 generate_data['top_k'] = Number(oai_settings.top_k_openai);
23982382 generate_data['stop'] = getCustomStoppingStrings(stopStringsLimit).slice(0, stopStringsLimit).filter(x => x.length >= 1 && x.length <= 16);
23992383 generate_data['use_makersuite_syspromptuse_sysprompt'] = oai_settings.use_makersuite_syspromptuse_sysprompt;
24002384 if (isVertexAI) {
24012385 generate_data['vertexai_auth_mode'] = oai_settings.vertexai_auth_mode;
24022386 generate_data['vertexai_region'] = oai_settings.vertexai_region;
@@ -3290,47 +3274,6 @@ class MessageCollection {
32903274 *
32913275 */
32923276export class ChatCompletion {
3293-
3294- /**
3295- * Combines consecutive system messages into one if they have no name attached.
3296- * @returns {Promise<void>}
3297- */
3298- async squashSystemMessages() {
3299- const excludeList = ['newMainChat', 'newChat', 'groupNudge'];
3300- this.messages.collection = this.messages.flatten();
3301-
3302- let lastMessage = null;
3303- let squashedMessages = [];
3304-
3305- for (let message of this.messages.collection) {
3306- // Force exclude empty messages
3307- if (message.role === 'system' && !message.content) {
3308- continue;
3309- }
3310-
3311- const shouldSquash = (message) => {
3312- return !excludeList.includes(message.identifier) && message.role === 'system' && !message.name;
3313- };
3314-
3315- if (shouldSquash(message)) {
3316- if (lastMessage && shouldSquash(lastMessage)) {
3317- lastMessage.content += '\n' + message.content;
3318- lastMessage.tokens = await tokenHandler.countAsync({ role: lastMessage.role, content: lastMessage.content });
3319- }
3320- else {
3321- squashedMessages.push(message);
3322- lastMessage = message;
3323- }
3324- }
3325- else {
3326- squashedMessages.push(message);
3327- lastMessage = message;
3328- }
3329- }
3330-
3331- this.messages.collection = squashedMessages;
3332- }
3333-
33343277 /**
33353278 * Initializes a new instance of ChatCompletion.
33363279 * Sets up the initial token budget and a new message collection.
@@ -3644,6 +3587,40 @@ export class ChatCompletion {
36443587}
36453588
36463589/**
3590+ * Migrate old Chat Completion settings to new format.
3591+ * @param {ChatCompletionSettings} settings Settings to migrate
3592+ */
3593+function migrateChatCompletionSettings(settings) {
3594+ const migrateMap = [
3595+ { oldKey: 'names_in_completion', oldValue: true, newKey: 'names_behavior', newValue: character_names_behavior.COMPLETION },
3596+ { oldKey: 'chat_completion_source', oldValue: 'palm', newKey: 'chat_completion_source', newValue: chat_completion_sources.MAKERSUITE },
3597+ { oldKey: 'custom_prompt_post_processing', oldValue: custom_prompt_post_processing_types.CLAUDE, newKey: 'custom_prompt_post_processing', newValue: custom_prompt_post_processing_types.MERGE },
3598+ { oldKey: 'ai21_model', oldValue: /^j2-/, newKey: 'ai21_model', newValue: 'jamba-large' },
3599+ { oldKey: 'image_inlining', oldValue: false, newKey: 'media_inlining', newValue: false },
3600+ { oldKey: 'image_inlining', oldValue: true, newKey: 'media_inlining', newValue: true },
3601+ { oldKey: 'video_inlining', oldValue: true, newKey: 'media_inlining', newValue: true },
3602+ { oldKey: 'audio_inlining', oldValue: true, newKey: 'media_inlining', newValue: true },
3603+ { oldKey: 'claude_use_sysprompt', oldValue: true, newKey: 'use_sysprompt', newValue: true },
3604+ { oldKey: 'use_makersuite_sysprompt', oldValue: true, newKey: 'use_sysprompt', newValue: true },
3605+ { oldKey: 'mistralai_model', oldValue: /^(mistral-medium|mistral-small)$/, newKey: 'mistralai_model', newValue: (settings.mistralai_model + '-latest') },
3606+ ];
3607+
3608+ for (const migration of migrateMap) {
3609+ if (Object.hasOwn(settings, migration.oldKey)) {
3610+ const shouldMigrate = migration.oldValue instanceof RegExp
3611+ ? migration.oldValue.test(settings[migration.oldKey])
3612+ : settings[migration.oldKey] === migration.oldValue;
3613+ if (shouldMigrate) {
3614+ settings[migration.newKey] = migration.newValue;
3615+ }
3616+ if (migration.oldKey !== migration.newKey) {
3617+ delete settings[migration.oldKey];
3618+ }
3619+ }
3620+ }
3621+}
3622+
3623+/**
36473624 * Load OpenAI settings from backend data
36483625 * @param {any} data Settings data from backend
36493626 * @param {ChatCompletionSettings} settings Saved settings from backend
@@ -3667,23 +3644,7 @@ function loadOpenAISettings(data, settings) {
36673644 });
36683645 openai_setting_names = settingNames;
36693646
3670- const migrateMap = [
3647+ migrateChatCompletionSettings(settings);
3671- { oldKey: 'names_in_completion', oldValue: true, newKey: 'names_behavior', newValue: character_names_behavior.COMPLETION },
3672- { oldKey: 'chat_completion_source', oldValue: 'palm', newKey: 'chat_completion_source', newValue: chat_completion_sources.MAKERSUITE },
3673- { oldKey: 'custom_prompt_post_processing', oldValue: custom_prompt_post_processing_types.CLAUDE, newKey: 'custom_prompt_post_processing', newValue: custom_prompt_post_processing_types.MERGE },
3674- { oldKey: 'ai21_model', oldValue: /^j2-/, newKey: 'ai21_model', newValue: 'jamba-large' },
3675- ];
3676-
3677- for (const migration of migrateMap) {
3678- if (Object.hasOwn(settings, migration.oldKey)) {
3679- const shouldMigrate = migration.oldValue instanceof RegExp
3680- ? migration.oldValue.test(settings[migration.oldKey])
3681- : settings[migration.oldKey] === migration.oldValue;
3682- if (shouldMigrate) {
3683- settings[migration.newKey] = migration.newValue;
3684- }
3685- }
3686- }
36873648
36883649 for (const key of Object.keys(default_settings)) {
36893650 oai_settings[key] = settings[key] ?? default_settings[key];
@@ -4319,15 +4280,7 @@ function onSettingsPresetChange() {
43194280
43204281 const preset = structuredClone(openai_settings[openai_setting_names[oai_settings.preset_settings_openai]]);
43214282
4322- // Migrate old settings
4283+ migrateChatCompletionSettings(preset);
4323- if (preset.names_in_completion === true && preset.names_behavior === undefined) {
4324- preset.names_behavior = character_names_behavior.COMPLETION;
4325- }
4326-
4327- // Claude: Assistant Impersonation Prefill = Inherit from Assistant Prefill
4328- if (preset.assistant_prefill !== undefined && preset.assistant_impersonation === undefined) {
4329- preset.assistant_impersonation = preset.assistant_prefill;
4330- }
43314284
43324285 const updateInput = (selector, value) => $(selector).val(value).trigger('input', { source: 'preset' });
43334286 const updateCheckbox = (selector, value) => $(selector).prop('checked', value).trigger('input', { source: 'preset' });
@@ -4739,11 +4692,6 @@ async function onModelChange() {
47394692 console.debug('Null MistralAI model selected. Ignoring.');
47404693 return;
47414694 }
4742- // Upgrade old mistral models to new naming scheme
4743- // would have done this in loadOpenAISettings, but it wasn't updating on preset change?
4744- if (value === 'mistral-medium' || value === 'mistral-small') {
4745- value = value + '-latest';
4746- }
47474695 console.log('MistralAI model changed to', value);
47484696 oai_settings.mistralai_model = value;
47494697 $('#model_mistralai_select').val(oai_settings.mistralai_model);
@@ -5436,7 +5384,7 @@ export function isImageInliningSupported() {
54365384 return false;
54375385 }
54385386
54395387 if (!oai_settings.image_inliningmedia_inlining) {
54405388 return false;
54415389 }
54425390
@@ -5551,7 +5499,7 @@ export function isVideoInliningSupported() {
55515499 return false;
55525500 }
55535501
55545502 if (!oai_settings.video_inliningmedia_inlining) {
55555503 return false;
55565504 }
55575505
@@ -5584,7 +5532,7 @@ export function isAudioInliningSupported() {
55845532 return false;
55855533 }
55865534
55875535 if (!oai_settings.audio_inliningmedia_inlining) {
55885536 return false;
55895537 }
55905538
@@ -5968,18 +5916,8 @@ export function initOpenAI() {
59685916 saveSettingsDebounced();
59695917 });
59705918
59715919 $('#wrap_in_quotesuse_sysprompt').on('change', function () {
59725920 oai_settings.wrap_in_quotesuse_sysprompt = !!$('#wrap_in_quotesuse_sysprompt').prop('checked');
5973- saveSettingsDebounced();
5974- });
5975-
5976- $('#claude_use_sysprompt').on('change', function () {
5977- oai_settings.claude_use_sysprompt = !!$('#claude_use_sysprompt').prop('checked');
5978- saveSettingsDebounced();
5979- });
5980-
5981- $('#use_makersuite_sysprompt').on('change', function () {
5982- oai_settings.use_makersuite_sysprompt = !!$('#use_makersuite_sysprompt').prop('checked');
59835921 saveSettingsDebounced();
59845922 });
59855923
@@ -6174,13 +6112,8 @@ export function initOpenAI() {
61746112 saveSettingsDebounced();
61756113 });
61766114
61776115 $('#squash_system_messagesopenai_media_inlining').on('input', function () {
61786116 oai_settings.squash_system_messagesmedia_inlining = !!$(this).prop('checked');
6179- saveSettingsDebounced();
6180- });
6181-
6182- $('#openai_image_inlining').on('input', function () {
6183- oai_settings.image_inlining = !!$(this).prop('checked');
61846117 updateFeatureSupportFlags();
61856118 saveSettingsDebounced();
61866119 });
@@ -6190,18 +6123,6 @@ export function initOpenAI() {
61906123 saveSettingsDebounced();
61916124 });
61926125
6193- $('#openai_video_inlining').on('input', function () {
6194- oai_settings.video_inlining = !!$(this).prop('checked');
6195- updateFeatureSupportFlags();
6196- saveSettingsDebounced();
6197- });
6198-
6199- $('#openai_audio_inlining').on('input', function () {
6200- oai_settings.audio_inlining = !!$(this).prop('checked');
6201- updateFeatureSupportFlags();
6202- saveSettingsDebounced();
6203- });
6204-
62056126 $('#continue_prefill').on('input', function () {
62066127 oai_settings.continue_prefill = !!$(this).prop('checked');
62076128 saveSettingsDebounced();
src/endpoints/backends/chat-completions.js+2 -2
@@ -158,7 +158,7 @@ async function sendClaudeRequest(request, response) {
158158 const additionalHeaders = {};
159159 const betaHeaders = ['output-128k-2025-02-19'];
160160 const useTools = Array.isArray(request.body.tools) && request.body.tools.length > 0;
161161 const useSystemPrompt = Boolean(request.body.claude_use_syspromptuse_sysprompt);
162162 const convertedPrompt = convertClaudeMessages(request.body.messages, request.body.assistant_prefill, useSystemPrompt, useTools, getPromptNames(request));
163163 const useThinking = /^claude-(3-7|opus-4|sonnet-4|haiku-4-5|opus-4-5)/.test(request.body.model);
164164 const useWebSearch = /^claude-(3-5|3-7|opus-4|sonnet-4|haiku-4-5|opus-4-5)/.test(request.body.model) && Boolean(request.body.enable_web_search);
@@ -406,7 +406,7 @@ async function sendMakerSuiteRequest(request, response) {
406406 generationConfig.responseModalities = ['text', 'image'];
407407 }
408408
409409 const useSystemPrompt = !enableImageModality && !isGemma && request.body.use_makersuite_syspromptuse_sysprompt;
410410
411411 const tools = [];
412412 const prompt = convertGooglePrompt(request.body.messages, model, useSystemPrompt, getPromptNames(request));