diff --git a/public/script.js b/public/script.js index 76acef1d6..85ac548ee 100644 --- a/public/script.js +++ b/public/script.js @@ -2003,7 +2003,7 @@ export function messageFormatting(mes, ch_name, isSystem, isUser, messageId, san return ''; } - if (Number(messageId) === 0 && !isSystem && !isUser) { + if (Number(messageId) === 0 && !isSystem && !isUser && !isReasoning) { const mesBeforeReplace = mes; const chatMessage = chat[messageId]; mes = substituteParams(mes, undefined, ch_name); @@ -3171,7 +3171,7 @@ class StreamingProcessor { this.sendTextarea.dispatchEvent(new Event('input', { bubbles: true })); } else { - await saveReply(this.type, text, true); + await saveReply(this.type, text, true, '', [], ''); messageId = chat.length - 1; this.#checkDomElements(messageId); this.showMessageButtons(messageId); @@ -3365,7 +3365,7 @@ class StreamingProcessor { const timestamps = []; for await (const { text, swipes, logprobs, toolCalls, state } of this.generator()) { timestamps.push(Date.now()); - if (this.isStopped) { + if (this.isStopped || this.abortController.signal.aborted) { return; } diff --git a/public/scripts/backgrounds.js b/public/scripts/backgrounds.js index 683e9c4ee..4ec8bf1f6 100644 --- a/public/scripts/backgrounds.js +++ b/public/scripts/backgrounds.js @@ -96,8 +96,13 @@ function highlightLockedBackground() { }); } +/** + * Locks the background for the current chat + * @param {Event} e Click event + * @returns {string} Empty string + */ function onLockBackgroundClick(e) { - e.stopPropagation(); + e?.stopPropagation(); const chatName = getCurrentChatId(); @@ -114,8 +119,13 @@ function onLockBackgroundClick(e) { return ''; } +/** + * Locks the background for the current chat + * @param {Event} e Click event + * @returns {string} Empty string + */ function onUnlockBackgroundClick(e) { - e.stopPropagation(); + e?.stopPropagation(); removeBackgroundMetadata(); unsetCustomBackground(); highlightLockedBackground(); @@ -513,12 +523,12 @@ export function initBackgrounds() { $('#add_bg_button').on('change', onBackgroundUploadSelected); $('#bg-filter').on('input', onBackgroundFilterInput); SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'lockbg', - callback: onLockBackgroundClick, + callback: () => onLockBackgroundClick(new CustomEvent('click')), aliases: ['bglock'], helpString: 'Locks a background for the currently selected chat', })); SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'unlockbg', - callback: onUnlockBackgroundClick, + callback: () => onUnlockBackgroundClick(new CustomEvent('click')), aliases: ['bgunlock'], helpString: 'Unlocks a background for the currently selected chat', })); diff --git a/public/scripts/reasoning.js b/public/scripts/reasoning.js index 74ce1db50..421eb65b1 100644 --- a/public/scripts/reasoning.js +++ b/public/scripts/reasoning.js @@ -123,6 +123,7 @@ function loadReasoningSettings() { function registerReasoningSlashCommands() { SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'reasoning-get', + aliases: ['get-reasoning'], returns: ARGUMENT_TYPE.STRING, helpString: t`Get the contents of a reasoning block of a message. Returns an empty string if the message does not have a reasoning block.`, unnamedArgumentList: [ @@ -142,6 +143,7 @@ function registerReasoningSlashCommands() { SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'reasoning-set', + aliases: ['set-reasoning'], returns: ARGUMENT_TYPE.STRING, helpString: t`Set the reasoning block of a message. Returns the reasoning block content.`, namedArgumentList: [ @@ -176,6 +178,7 @@ function registerReasoningSlashCommands() { SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'reasoning-parse', + aliases: ['parse-reasoning'], returns: 'reasoning string', helpString: t`Extracts the reasoning block from a string using the Reasoning Formatting settings.`, namedArgumentList: [ diff --git a/public/scripts/textgen-models.js b/public/scripts/textgen-models.js index 824d5eec4..9523cfba5 100644 --- a/public/scripts/textgen-models.js +++ b/public/scripts/textgen-models.js @@ -54,6 +54,12 @@ const OPENROUTER_PROVIDERS = [ 'xAI', 'Cloudflare', 'SF Compute', + 'Minimax', + 'Nineteen', + 'Liquid', + 'Nebius', + 'Chutes', + 'Kluster', '01.AI', 'HuggingFace', 'Mancer',