mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into hidden-reasoning-tracking
This commit is contained in:
@@ -3749,8 +3749,8 @@
|
||||
</div>
|
||||
<label class="checkbox_label" for="custom_stopping_strings_macro">
|
||||
<input id="custom_stopping_strings_macro" type="checkbox" checked>
|
||||
<small data-i18n="Replace Macro in Custom Stopping Strings">
|
||||
Replace Macro in Custom Stopping Strings
|
||||
<small data-i18n="Replace Macro in Stop Strings">
|
||||
Replace Macro in Stop Strings
|
||||
</small>
|
||||
</label>
|
||||
</div>
|
||||
@@ -3797,44 +3797,53 @@
|
||||
<span data-i18n="Reasoning">Reasoning</span>
|
||||
</h4>
|
||||
<div>
|
||||
<label class="checkbox_label" for="reasoning_auto_parse" title="Automatically parse reasoning blocks from main content between the reasoning prefix/suffix. Both fields must be defined and non-empty." data-i18n="[title]reasoning_auto_parse">
|
||||
<input id="reasoning_auto_parse" type="checkbox" />
|
||||
<small data-i18n="Auto-Parse Reasoning">
|
||||
Auto-Parse Reasoning
|
||||
</small>
|
||||
</label>
|
||||
<label class="checkbox_label" for="reasoning_auto_expand" title="Automatically expand reasoning blocks." data-i18n="[title]reasoning_auto_expand">
|
||||
<input id="reasoning_auto_expand" type="checkbox" />
|
||||
<small data-i18n="Auto-Expand Reasoning">
|
||||
Auto-Expand Reasoning
|
||||
</small>
|
||||
</label>
|
||||
<label class="checkbox_label" for="reasoning_add_to_prompts" title="Add existing reasoning blocks to prompts. To add a new reasoning block, use the message edit menu." data-i18n="[title]reasoning_add_to_prompts">
|
||||
<input id="reasoning_add_to_prompts" type="checkbox" />
|
||||
<small data-i18n="Add Reasoning to Prompts">
|
||||
Add Reasoning to Prompts
|
||||
</small>
|
||||
</label>
|
||||
<div class="flex-container">
|
||||
<div class="flex1" title="Inserted before the reasoning content." data-i18n="[title]reasoning_prefix">
|
||||
<small data-i18n="Prefix">Prefix</small>
|
||||
<textarea id="reasoning_prefix" class="text_pole textarea_compact autoSetHeight"></textarea>
|
||||
</div>
|
||||
<div class="flex1" title="Inserted after the reasoning content." data-i18n="[title]reasoning_suffix">
|
||||
<small data-i18n="Suffix">Suffix</small>
|
||||
<textarea id="reasoning_suffix" class="text_pole textarea_compact autoSetHeight"></textarea>
|
||||
<div class="flex-container alignItemsBaseline">
|
||||
<label class="checkbox_label flex1" for="reasoning_auto_parse" title="Automatically parse reasoning blocks from main content between the reasoning prefix/suffix. Both fields must be defined and non-empty." data-i18n="[title]reasoning_auto_parse">
|
||||
<input id="reasoning_auto_parse" type="checkbox" />
|
||||
<small data-i18n="Auto-Parse">
|
||||
Auto-Parse
|
||||
</small>
|
||||
</label>
|
||||
<label class="checkbox_label flex1" for="reasoning_auto_expand" title="Automatically expand reasoning blocks." data-i18n="[title]reasoning_auto_expand">
|
||||
<input id="reasoning_auto_expand" type="checkbox" />
|
||||
<small data-i18n="Auto-Expand">
|
||||
Auto-Expand
|
||||
</small>
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex-container alignItemsBaseline">
|
||||
<label class="checkbox_label flex1" for="reasoning_add_to_prompts" title="Add existing reasoning blocks to prompts. To add a new reasoning block, use the message edit menu." data-i18n="[title]reasoning_add_to_prompts">
|
||||
<input id="reasoning_add_to_prompts" type="checkbox" />
|
||||
<small data-i18n="Add to Prompts">
|
||||
Add to Prompts
|
||||
</small>
|
||||
</label>
|
||||
<div class="flex1 flex-container alignItemsBaseline" title="Maximum number of reasoning blocks to be added per prompt, counting from the last message." data-i18n="[title]reasoning_max_additions">
|
||||
<input id="reasoning_max_additions" class="text_pole textarea_compact widthUnset" type="number" min="0" max="999"></textarea>
|
||||
<small data-i18n="Max">Max</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-container">
|
||||
<div class="flex1" title="Inserted between the reasoning and the message content." data-i18n="[title]reasoning_separator">
|
||||
<small data-i18n="Separator">Separator</small>
|
||||
<textarea id="reasoning_separator" class="text_pole textarea_compact autoSetHeight"></textarea>
|
||||
<details>
|
||||
<summary data-i18n="Reasoning Formatting">
|
||||
Reasoning Formatting
|
||||
</summary>
|
||||
<div class="flex-container">
|
||||
<div class="flex1" title="Inserted before the reasoning content." data-i18n="[title]reasoning_prefix">
|
||||
<small data-i18n="Prefix">Prefix</small>
|
||||
<textarea id="reasoning_prefix" class="text_pole textarea_compact autoSetHeight"></textarea>
|
||||
</div>
|
||||
<div class="flex1" title="Inserted after the reasoning content." data-i18n="[title]reasoning_suffix">
|
||||
<small data-i18n="Suffix">Suffix</small>
|
||||
<textarea id="reasoning_suffix" class="text_pole textarea_compact autoSetHeight"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex1" title="Maximum number of reasoning blocks to be added per prompt, counting from the last message." data-i18n="[title]reasoning_max_additions">
|
||||
<small data-i18n="Max Additions">Max Additions</small>
|
||||
<input id="reasoning_max_additions" class="text_pole textarea_compact" type="number" min="0" max="999"></textarea>
|
||||
<div class="flex-container">
|
||||
<div class="flex1" title="Inserted between the reasoning and the message content." data-i18n="[title]reasoning_separator">
|
||||
<small data-i18n="Separator">Separator</small>
|
||||
<textarea id="reasoning_separator" class="text_pole textarea_compact autoSetHeight"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
@@ -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)": "الطول المستهدف (رموز)",
|
||||
|
@@ -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)",
|
||||
|
@@ -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)",
|
||||
|
@@ -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)",
|
||||
|
@@ -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)",
|
||||
|
@@ -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)",
|
||||
|
@@ -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)": "ターゲット長さ(トークン)",
|
||||
|
@@ -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)": "대상 길이 (토큰)",
|
||||
|
@@ -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)",
|
||||
|
@@ -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)",
|
||||
|
@@ -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": "Начало чата",
|
||||
|
@@ -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)": "Цільова довжина (токени)",
|
||||
|
@@ -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)",
|
||||
|
@@ -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 字符串",
|
||||
|
@@ -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)": "目標長度(符元)",
|
||||
|
@@ -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
|
||||
|
@@ -621,21 +621,56 @@ async function enlargeMessageImage() {
|
||||
}
|
||||
|
||||
async function deleteMessageImage() {
|
||||
const value = await callGenericPopup('<h3>Delete image from message?<br>This action can\'t be undone.</h3>', POPUP_TYPE.CONFIRM);
|
||||
const value = await callGenericPopup('<h3>Delete image from message?<br>This action can\'t be undone.</h3>', 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();
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<select id="caption_source" class="text_pole">
|
||||
<option value="local" data-i18n="Local">Local</option>
|
||||
<option value="multimodal" data-i18n="Multimodal (OpenAI / Anthropic / llama / Google)">Multimodal (OpenAI / Anthropic / llama / Google)</option>
|
||||
<option value="extras" data-i18n="Extras">Extras</option>
|
||||
<option value="extras" data-i18n="Extras">Extras (deprecated)</option>
|
||||
<option value="horde" data-i18n="Horde">Horde</option>
|
||||
</select>
|
||||
<div id="caption_multimodal_block" class="flex-container wide100p">
|
||||
|
@@ -23,7 +23,7 @@
|
||||
<small data-i18n="Select the API for classifying expressions.">Select the API for classifying expressions.</small>
|
||||
<select id="expression_api" class="flex1 margin0">
|
||||
<option value="0" data-i18n="Local">Local</option>
|
||||
<option value="1" data-i18n="Extras">Extras</option>
|
||||
<option value="1" data-i18n="Extras">Extras (deprecated)</option>
|
||||
<option value="2" data-i18n="Main API">Main API</option>
|
||||
<option value="3" data-i18n="WebLLM Extension">WebLLM Extension</option>
|
||||
</select>
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<label for="summary_source" data-i18n="ext_sum_with">Summarize with:</label>
|
||||
<select id="summary_source">
|
||||
<option value="main" data-i18n="ext_sum_main_api">Main API</option>
|
||||
<option value="extras">Extras API</option>
|
||||
<option value="extras">Extras API (deprecated)</option>
|
||||
<option value="webllm" data-i18n="ext_sum_webllm">WebLLM Extension</option>
|
||||
</select><br>
|
||||
|
||||
|
@@ -41,7 +41,7 @@
|
||||
<option value="blockentropy">Block Entropy</option>
|
||||
<option value="comfy">ComfyUI</option>
|
||||
<option value="drawthings">DrawThings HTTP API</option>
|
||||
<option value="extras">Extras API (local / remote)</option>
|
||||
<option value="extras">Extras API (deprecated)</option>
|
||||
<option value="huggingface">HuggingFace Inference API (serverless)</option>
|
||||
<option value="nanogpt">NanoGPT</option>
|
||||
<option value="novel">NovelAI Diffusion</option>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
</label>
|
||||
<select id="vectors_source" class="text_pole">
|
||||
<option value="cohere">Cohere</option>
|
||||
<option value="extras">Extras</option>
|
||||
<option value="extras">Extras (deprecated)</option>
|
||||
<option value="palm">Google AI Studio</option>
|
||||
<option value="llamacpp">llama.cpp</option>
|
||||
<option value="transformers" data-i18n="Local (Transformers)">Local (Transformers)</option>
|
||||
|
@@ -24,6 +24,15 @@ export const POPUP_RESULT = {
|
||||
AFFIRMATIVE: 1,
|
||||
NEGATIVE: 0,
|
||||
CANCELLED: null,
|
||||
CUSTOM1: 1001,
|
||||
CUSTOM2: 1002,
|
||||
CUSTOM3: 1003,
|
||||
CUSTOM4: 1004,
|
||||
CUSTOM5: 1005,
|
||||
CUSTOM6: 1006,
|
||||
CUSTOM7: 1007,
|
||||
CUSTOM8: 1008,
|
||||
CUSTOM9: 1009,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -2451,7 +2451,7 @@ async function resetMovablePanels(type) {
|
||||
}
|
||||
|
||||
saveSettingsDebounced();
|
||||
eventSource.emit(event_types.MOVABLE_PANELS_RESET);
|
||||
await eventSource.emit(event_types.MOVABLE_PANELS_RESET);
|
||||
|
||||
eventSource.once(event_types.SETTINGS_UPDATED, () => {
|
||||
$('.resizing').removeClass('resizing');
|
||||
|
@@ -40,6 +40,7 @@ export const SECRET_KEYS = {
|
||||
BFL: 'api_key_bfl',
|
||||
GENERIC: 'api_key_generic',
|
||||
DEEPSEEK: 'api_key_deepseek',
|
||||
SERPER: 'api_key_serper',
|
||||
};
|
||||
|
||||
const INPUT_MAP = {
|
||||
|
@@ -1221,7 +1221,7 @@ function replaceMacrosInList(str) {
|
||||
}
|
||||
}
|
||||
|
||||
export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, isContinue, cfgValues, type) {
|
||||
export async function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, isContinue, cfgValues, type) {
|
||||
const canMultiSwipe = !isContinue && !isImpersonate && type !== 'quiet';
|
||||
const dynatemp = isDynamicTemperatureSupported();
|
||||
const { banned_tokens, banned_strings } = getCustomTokenBans();
|
||||
@@ -1449,7 +1449,7 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
|
||||
}
|
||||
}
|
||||
|
||||
eventSource.emitAndWait(event_types.TEXT_COMPLETION_SETTINGS_READY, params);
|
||||
await eventSource.emit(event_types.TEXT_COMPLETION_SETTINGS_READY, params);
|
||||
|
||||
// Grammar conflicts with with json_schema
|
||||
if (settings.type === LLAMACPP) {
|
||||
|
@@ -3452,7 +3452,7 @@ async function _save(name, data) {
|
||||
headers: getRequestHeaders(),
|
||||
body: JSON.stringify({ name: name, data: data }),
|
||||
});
|
||||
eventSource.emit(event_types.WORLDINFO_UPDATED, name, data);
|
||||
await eventSource.emit(event_types.WORLDINFO_UPDATED, name, data);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -5745,11 +5745,13 @@ body:not(.movingUI) .drawer-content.maximized {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
#SystemPromptColumn summary,
|
||||
#InstructSequencesColumn summary {
|
||||
font-size: 0.95em;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#SystemPromptColumn details,
|
||||
#InstructSequencesColumn details:not(:last-of-type) {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
@@ -112,6 +112,7 @@ router.post('/serpapi', jsonParser, async (request, response) => {
|
||||
}
|
||||
|
||||
const data = await result.json();
|
||||
console.debug('SerpApi response', data);
|
||||
return response.json(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -255,6 +256,7 @@ router.post('/tavily', jsonParser, async (request, response) => {
|
||||
}
|
||||
|
||||
const data = await result.json();
|
||||
console.debug('Tavily response', data);
|
||||
return response.json(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -290,6 +292,49 @@ router.post('/koboldcpp', jsonParser, async (request, response) => {
|
||||
}
|
||||
|
||||
const data = await result.json();
|
||||
console.debug('KoboldCpp search response', data);
|
||||
return response.json(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return response.sendStatus(500);
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/serper', jsonParser, async (request, response) => {
|
||||
try {
|
||||
const key = readSecret(request.user.directories, SECRET_KEYS.SERPER);
|
||||
|
||||
if (!key) {
|
||||
console.error('No Serper key found');
|
||||
return response.sendStatus(400);
|
||||
}
|
||||
|
||||
const { query, images } = request.body;
|
||||
|
||||
const url = images
|
||||
? 'https://google.serper.dev/images'
|
||||
: 'https://google.serper.dev/search';
|
||||
|
||||
const result = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-API-KEY': key,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
redirect: 'follow',
|
||||
body: JSON.stringify({ q: query }),
|
||||
});
|
||||
|
||||
console.debug('Serper query', query);
|
||||
|
||||
if (!result.ok) {
|
||||
const text = await result.text();
|
||||
console.warn('Serper request failed', result.statusText, text);
|
||||
return response.status(500).send(text);
|
||||
}
|
||||
|
||||
const data = await result.json();
|
||||
console.debug('Serper response', data);
|
||||
return response.json(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
@@ -52,6 +52,7 @@ export const SECRET_KEYS = {
|
||||
BFL: 'api_key_bfl',
|
||||
GENERIC: 'api_key_generic',
|
||||
DEEPSEEK: 'api_key_deepseek',
|
||||
SERPER: 'api_key_serper',
|
||||
};
|
||||
|
||||
// These are the keys that are safe to expose, even if allowKeysExposure is false
|
||||
|
Reference in New Issue
Block a user