diff --git a/public/index.html b/public/index.html index 82ab25778..20ffc6d0b 100644 --- a/public/index.html +++ b/public/index.html @@ -3749,8 +3749,8 @@ @@ -3797,44 +3797,53 @@ Reasoning
- - - -
-
- Prefix - -
-
- Suffix - +
+ + +
+
+ +
+ + Max
-
-
- Separator - +
+ + Reasoning Formatting + +
+
+ Prefix + +
+
+ Suffix + +
-
- Max Additions - +
+
+ Separator + +
-
+
diff --git a/public/locales/ar-sa.json b/public/locales/ar-sa.json index 46f8a2805..c0bc382f1 100644 --- a/public/locales/ar-sa.json +++ b/public/locales/ar-sa.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "فصل بفواصل دون مسافة بينها", "Custom Stopping Strings": "سلاسل توقف مخصصة", "JSON serialized array of strings": "مصفوفة سلسلة JSON متسلسلة", - "Replace Macro in Custom Stopping Strings": "استبدال الماكرو في سلاسل التوقف المخصصة", + "Replace Macro in Stop Strings": "استبدال الماكرو في سلاسل التوقف المخصصة", "Auto-Continue": "المتابعة التلقائية", "Allow for Chat Completion APIs": "السماح بواجهات برمجة التطبيقات لإكمال الدردشة", "Target length (tokens)": "الطول المستهدف (رموز)", diff --git a/public/locales/de-de.json b/public/locales/de-de.json index a10d80e0b..d1ba2fb0b 100644 --- a/public/locales/de-de.json +++ b/public/locales/de-de.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "getrennt durch Kommas ohne Leerzeichen dazwischen", "Custom Stopping Strings": "Benutzerdefinierte Stoppzeichenfolgen", "JSON serialized array of strings": "JSON serialisierte Reihe von Zeichenfolgen", - "Replace Macro in Custom Stopping Strings": "Makro in benutzerdefinierten Stoppzeichenfolgen ersetzen", + "Replace Macro in Stop Strings": "Makro in benutzerdefinierten Stoppzeichenfolgen ersetzen", "Auto-Continue": "Automatisch fortsetzen", "Allow for Chat Completion APIs": "Erlaube Chat-Vervollständigungs-APIs", "Target length (tokens)": "Ziel-Länge (Tokens)", diff --git a/public/locales/es-es.json b/public/locales/es-es.json index 334a283b3..5794c1e7f 100644 --- a/public/locales/es-es.json +++ b/public/locales/es-es.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "separe con comas sin espacio entre ellas", "Custom Stopping Strings": "Cadenas de Detención Personalizadas", "JSON serialized array of strings": "Arreglo de cadenas serializado en JSON", - "Replace Macro in Custom Stopping Strings": "Reemplazar macro en Cadenas de Detención Personalizadas", + "Replace Macro in Stop Strings": "Reemplazar macro en Cadenas de Detención Personalizadas", "Auto-Continue": "Autocontinuar", "Allow for Chat Completion APIs": "Permitir para APIs de Completado de Chat", "Target length (tokens)": "Longitud objetivo (tokens)", diff --git a/public/locales/fr-fr.json b/public/locales/fr-fr.json index 8caacde2d..16f10496c 100644 --- a/public/locales/fr-fr.json +++ b/public/locales/fr-fr.json @@ -434,7 +434,7 @@ "Non-markdown strings": "Chaînes non Markdown", "Custom Stopping Strings": "Chaînes d'arrêt personnalisées", "JSON serialized array of strings": "Tableau de chaînes sérialisé JSON", - "Replace Macro in Custom Stopping Strings": "Remplacer les macro dans les chaînes d'arrêt personnalisées", + "Replace Macro in Stop Strings": "Remplacer les macro dans les chaînes d'arrêt personnalisées", "Auto-Continue": "Auto-Continue", "Allow for Chat Completion APIs": "Autoriser les APIs de complétion de chat", "Target length (tokens)": "Longueur cible (tokens)", diff --git a/public/locales/is-is.json b/public/locales/is-is.json index 2cacc1511..4bfc1e7b7 100644 --- a/public/locales/is-is.json +++ b/public/locales/is-is.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "aðskilið með kommum án bila milli", "Custom Stopping Strings": "Eigin stopp-strengir", "JSON serialized array of strings": "JSON raðað fylki af strengjum", - "Replace Macro in Custom Stopping Strings": "Skiptu út í macro í sérsniðnum stoppa strengjum", + "Replace Macro in Stop Strings": "Skiptu út í macro í sérsniðnum stoppa strengjum", "Auto-Continue": "Sjálfvirk Forná", "Allow for Chat Completion APIs": "Leyfa fyrir spjall Loka APIs", "Target length (tokens)": "Markaðarlengd (texti)", diff --git a/public/locales/it-it.json b/public/locales/it-it.json index eeea5c0fb..e833745b7 100644 --- a/public/locales/it-it.json +++ b/public/locales/it-it.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "separati con virgole senza spazio tra loro", "Custom Stopping Strings": "Stringhe di Stop Personalizzate", "JSON serialized array of strings": "Matrice serializzata JSON di stringhe", - "Replace Macro in Custom Stopping Strings": "Sostituisci Macro in Stringhe di Arresto Personalizzate", + "Replace Macro in Stop Strings": "Sostituisci Macro in Stringhe di Arresto Personalizzate", "Auto-Continue": "Auto-continua", "Allow for Chat Completion APIs": "Consenti per API di completamento chat", "Target length (tokens)": "Lunghezza obiettivo (token)", diff --git a/public/locales/ja-jp.json b/public/locales/ja-jp.json index 2b3119e6e..b30a77b06 100644 --- a/public/locales/ja-jp.json +++ b/public/locales/ja-jp.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "間にスペースのないカンマで区切ります", "Custom Stopping Strings": "カスタム停止文字列", "JSON serialized array of strings": "文字列のJSONシリアル化配列", - "Replace Macro in Custom Stopping Strings": "カスタム停止文字列内のマクロを置換する", + "Replace Macro in Stop Strings": "カスタム停止文字列内のマクロを置換する", "Auto-Continue": "自動継続", "Allow for Chat Completion APIs": "チャット補完APIを許可", "Target length (tokens)": "ターゲット長さ(トークン)", diff --git a/public/locales/ko-kr.json b/public/locales/ko-kr.json index 2c2dfca86..0eebca64c 100644 --- a/public/locales/ko-kr.json +++ b/public/locales/ko-kr.json @@ -492,7 +492,7 @@ "separate with commas w/o space between": "쉼표로 구분 (공백 없이)", "Custom Stopping Strings": "사용자 정의 중지 문자열", "JSON serialized array of strings": "문자열의 JSON 직렬화된 배열", - "Replace Macro in Custom Stopping Strings": "사용자 정의 중단 문자열에서 매크로 교체", + "Replace Macro in Stop Strings": "사용자 정의 중단 문자열에서 매크로 교체", "Auto-Continue": "자동 계속하기", "Allow for Chat Completion APIs": "채팅 완성 API 허용", "Target length (tokens)": "대상 길이 (토큰)", diff --git a/public/locales/nl-nl.json b/public/locales/nl-nl.json index c4820f5b8..317447f11 100644 --- a/public/locales/nl-nl.json +++ b/public/locales/nl-nl.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "gescheiden met komma's zonder spatie ertussen", "Custom Stopping Strings": "Aangepaste Stopreeksen", "JSON serialized array of strings": "JSON geserialiseerde reeks van strings", - "Replace Macro in Custom Stopping Strings": "Macro vervangen in aangepaste stopreeksen", + "Replace Macro in Stop Strings": "Macro vervangen in aangepaste stopreeksen", "Auto-Continue": "Automatisch doorgaan", "Allow for Chat Completion APIs": "Chatvervolledigings-API's toestaan", "Target length (tokens)": "Doellengte (tokens)", diff --git a/public/locales/pt-pt.json b/public/locales/pt-pt.json index 5a2fba569..cea383fcc 100644 --- a/public/locales/pt-pt.json +++ b/public/locales/pt-pt.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "separe com vírgulas sem espaço entre", "Custom Stopping Strings": "Cadeias de parada personalizadas", "JSON serialized array of strings": "Matriz de strings serializada em JSON", - "Replace Macro in Custom Stopping Strings": "Substituir Macro em Strings de Parada Personalizadas", + "Replace Macro in Stop Strings": "Substituir Macro em Strings de Parada Personalizadas", "Auto-Continue": "Auto-Continuar", "Allow for Chat Completion APIs": "Permitir APIs de Completar Chat", "Target length (tokens)": "Comprimento alvo (tokens)", diff --git a/public/locales/ru-ru.json b/public/locales/ru-ru.json index 4c67beaa9..8693cf7f5 100644 --- a/public/locales/ru-ru.json +++ b/public/locales/ru-ru.json @@ -161,7 +161,7 @@ "View hidden API keys": "Посмотреть скрытые API-ключи", "Advanced Formatting": "Расширенное форматирование", "Context Template": "Шаблон контекста", - "Replace Macro in Custom Stopping Strings": "Заменять макросы в пользовательских стоп-строках", + "Replace Macro in Stop Strings": "Заменять макросы в пользовательских стоп-строках", "Story String": "Строка истории", "Example Separator": "Разделитель примеров сообщений", "Chat Start": "Начало чата", diff --git a/public/locales/uk-ua.json b/public/locales/uk-ua.json index 216ed3928..ba371421d 100644 --- a/public/locales/uk-ua.json +++ b/public/locales/uk-ua.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "розділяйте комами без пропусків між ними", "Custom Stopping Strings": "Власні рядки зупинки", "JSON serialized array of strings": "JSON-серіалізований масив рядків", - "Replace Macro in Custom Stopping Strings": "Замінювати макроси у власних рядках зупинки", + "Replace Macro in Stop Strings": "Замінювати макроси у власних рядках зупинки", "Auto-Continue": "Автоматичне продовження", "Allow for Chat Completion APIs": "Дозволити для Chat Completion API", "Target length (tokens)": "Цільова довжина (токени)", diff --git a/public/locales/vi-vn.json b/public/locales/vi-vn.json index 36459e94f..f9a24d365 100644 --- a/public/locales/vi-vn.json +++ b/public/locales/vi-vn.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "phân tách bằng dấu phẩy không có khoảng trắng giữa", "Custom Stopping Strings": "Chuỗi dừng tùy chỉnh", "JSON serialized array of strings": "Mảng chuỗi được tuần tự hóa JSON", - "Replace Macro in Custom Stopping Strings": "Thay thế Macro trong Chuỗi Dừng Tùy chỉnh", + "Replace Macro in Stop Strings": "Thay thế Macro trong Chuỗi Dừng Tùy chỉnh", "Auto-Continue": "Tự động Tiếp tục", "Allow for Chat Completion APIs": "Cho phép các API hoàn thành Trò chuyện", "Target length (tokens)": "Độ dài mục tiêu (token)", diff --git a/public/locales/zh-cn.json b/public/locales/zh-cn.json index 7213669ab..a77a2a792 100644 --- a/public/locales/zh-cn.json +++ b/public/locales/zh-cn.json @@ -559,7 +559,7 @@ "Prompt Content": "提示词内容", "Custom Stopping Strings": "自定义停止字符串", "JSON serialized array of strings": "JSON序列化的字符串数组", - "Replace Macro in Custom Stopping Strings": "替换自定义停止字符串中的宏", + "Replace Macro in Stop Strings": "替换自定义停止字符串中的宏", "Token Padding": "词符填充", "Miscellaneous": "杂项", "Non-markdown strings": "非 Markdown 字符串", diff --git a/public/locales/zh-tw.json b/public/locales/zh-tw.json index 039748265..861af3f4d 100644 --- a/public/locales/zh-tw.json +++ b/public/locales/zh-tw.json @@ -483,7 +483,7 @@ "separate with commas w/o space between": "用逗號分隔,之間無空格", "Custom Stopping Strings": "自訂停止字串", "JSON serialized array of strings": "JSON 序列化字串數組", - "Replace Macro in Custom Stopping Strings": "取代自訂停止字串中的巨集", + "Replace Macro in Stop Strings": "取代自訂停止字串中的巨集", "Auto-Continue": "自動繼續", "Allow for Chat Completion APIs": "允許聊天補全 API", "Target length (tokens)": "目標長度(符元)", diff --git a/public/script.js b/public/script.js index 3133c9229..bba68a6cc 100644 --- a/public/script.js +++ b/public/script.js @@ -3451,7 +3451,7 @@ export async function generateRaw(prompt, api, instructOverride, quietToLoud, sy break; } case 'textgenerationwebui': - generateData = getTextGenGenerationData(prompt, amount_gen, false, false, null, 'quiet'); + generateData = await getTextGenGenerationData(prompt, amount_gen, false, false, null, 'quiet'); TempResponseLength.restore(api); break; case 'openai': { @@ -4588,7 +4588,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro break; case 'textgenerationwebui': { const cfgValues = useCfgPrompt ? { guidanceScale: cfgGuidanceScale, negativePrompt: await getCombinedPrompt(true) } : null; - generate_data = getTextGenGenerationData(finalPrompt, maxLength, isImpersonate, isContinue, cfgValues, type); + generate_data = await getTextGenGenerationData(finalPrompt, maxLength, isImpersonate, isContinue, cfgValues, type); break; } case 'novel': { @@ -6928,7 +6928,7 @@ export async function getSettings() { loadProxyPresets(settings); // Allow subscribers to mutate settings - eventSource.emit(event_types.SETTINGS_LOADED_AFTER, settings); + await eventSource.emit(event_types.SETTINGS_LOADED_AFTER, settings); // Set context size after loading power user (may override the max value) $('#max_context').val(max_context); @@ -6988,7 +6988,7 @@ export async function getSettings() { } await validateDisabledSamplers(); settingsReady = true; - eventSource.emit(event_types.SETTINGS_LOADED); + await eventSource.emit(event_types.SETTINGS_LOADED); } function selectKoboldGuiPreset() { @@ -11405,7 +11405,7 @@ jQuery(async function () { ); break;*/ default: - eventSource.emit('charManagementDropdown', target); + await eventSource.emit('charManagementDropdown', target); } $('#char-management-dropdown').prop('selectedIndex', 0); }); @@ -11567,7 +11567,7 @@ jQuery(async function () { $(document).on('click', '.open_characters_library', async function () { await getCharacters(); - eventSource.emit(event_types.OPEN_CHARACTER_LIBRARY); + await eventSource.emit(event_types.OPEN_CHARACTER_LIBRARY); }); // Added here to prevent execution before script.js is loaded and get rid of quirky timeouts diff --git a/public/scripts/chats.js b/public/scripts/chats.js index 94ad882bb..32c8e93e5 100644 --- a/public/scripts/chats.js +++ b/public/scripts/chats.js @@ -621,21 +621,56 @@ async function enlargeMessageImage() { } async function deleteMessageImage() { - const value = await callGenericPopup('

Delete image from message?
This action can\'t be undone.

', POPUP_TYPE.CONFIRM); + const value = await callGenericPopup('

Delete image from message?
This action can\'t be undone.

', POPUP_TYPE.TEXT, '', { + okButton: t`Delete one`, + customButtons: [ + { + text: t`Delete all`, + appendAtEnd: true, + result: POPUP_RESULT.CUSTOM1, + }, + { + text: t`Cancel`, + appendAtEnd: true, + result: POPUP_RESULT.CANCELLED, + }, + ], + }); - if (value !== POPUP_RESULT.AFFIRMATIVE) { + if (!value) { return; } const mesBlock = $(this).closest('.mes'); const mesId = mesBlock.attr('mesid'); const message = chat[mesId]; - delete message.extra.image; - delete message.extra.inline_image; - delete message.extra.title; - delete message.extra.append_title; - mesBlock.find('.mes_img_container').removeClass('img_extra'); - mesBlock.find('.mes_img').attr('src', ''); + + let isLastImage = true; + + if (Array.isArray(message.extra.image_swipes)) { + const indexOf = message.extra.image_swipes.indexOf(message.extra.image); + if (indexOf > -1) { + message.extra.image_swipes.splice(indexOf, 1); + isLastImage = message.extra.image_swipes.length === 0; + if (!isLastImage) { + const newIndex = Math.min(indexOf, message.extra.image_swipes.length - 1); + message.extra.image = message.extra.image_swipes[newIndex]; + } + } + } + + if (isLastImage || value === POPUP_RESULT.CUSTOM1) { + delete message.extra.image; + delete message.extra.inline_image; + delete message.extra.title; + delete message.extra.append_title; + delete message.extra.image_swipes; + mesBlock.find('.mes_img_container').removeClass('img_extra'); + mesBlock.find('.mes_img').attr('src', ''); + } else { + appendMediaToMessage(message, mesBlock); + } + await saveChatConditional(); } diff --git a/public/scripts/extensions/caption/settings.html b/public/scripts/extensions/caption/settings.html index 2dab71817..d379e03c8 100644 --- a/public/scripts/extensions/caption/settings.html +++ b/public/scripts/extensions/caption/settings.html @@ -10,7 +10,7 @@
diff --git a/public/scripts/extensions/expressions/settings.html b/public/scripts/extensions/expressions/settings.html index dc22debbd..e7a737a6b 100644 --- a/public/scripts/extensions/expressions/settings.html +++ b/public/scripts/extensions/expressions/settings.html @@ -23,7 +23,7 @@ Select the API for classifying expressions. diff --git a/public/scripts/extensions/memory/settings.html b/public/scripts/extensions/memory/settings.html index 40a58a905..262dd6715 100644 --- a/public/scripts/extensions/memory/settings.html +++ b/public/scripts/extensions/memory/settings.html @@ -12,7 +12,7 @@
diff --git a/public/scripts/extensions/stable-diffusion/settings.html b/public/scripts/extensions/stable-diffusion/settings.html index e1ae810c6..7969ef7e2 100644 --- a/public/scripts/extensions/stable-diffusion/settings.html +++ b/public/scripts/extensions/stable-diffusion/settings.html @@ -41,7 +41,7 @@ - + diff --git a/public/scripts/extensions/vectors/settings.html b/public/scripts/extensions/vectors/settings.html index 613217289..343850f4e 100644 --- a/public/scripts/extensions/vectors/settings.html +++ b/public/scripts/extensions/vectors/settings.html @@ -11,7 +11,7 @@