Merge branch 'staging' into tool-calling

c3e9d253077843a615511a067347a8237805e057

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

2 files changed, +17 -2Showing whitespace changes
public/script.js+16 -2
@@ -2373,7 +2373,7 @@ export function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll
2373 if (!params.isUser && newMessageId !== 0 && newMessageId !== chat.length - 1) {2373 if (!params.isUser && newMessageId !== 0 && newMessageId !== chat.length - 1) {
2374 const swipesNum = chat[newMessageId].swipes?.length;2374 const swipesNum = chat[newMessageId].swipes?.length;
2375 const swipeId = chat[newMessageId].swipe_id + 1;2375 const swipeId = chat[newMessageId].swipe_id + 1;
2376 newMessage.find('.swipes-counter').text(`${swipeId}\u200B/\u200b${swipesNum}`);2376 newMessage.find('.swipes-counter').text(formatSwipeCounter(swipeId, swipesNum));
2377 }2377 }
23782378
2379 if (showSwipes) {2379 if (showSwipes) {
@@ -7514,7 +7514,7 @@ export function showSwipeButtons() {
75147514
7515 const currentMessage = $('#chat').children().filter(`[mesid="${chat.length - 1}"]`);7515 const currentMessage = $('#chat').children().filter(`[mesid="${chat.length - 1}"]`);
7516 const swipeId = chat[chat.length - 1].swipe_id;7516 const swipeId = chat[chat.length - 1].swipe_id;
7517 const swipeCounterText = (`${(swipeId + 1)}\u200B/\u200b${(chat[chat.length - 1].swipes.length)}`);7517 const swipeCounterText = formatSwipeCounter((swipeId + 1), chat[chat.length - 1].swipes.length);
7518 const swipeRight = currentMessage.find('.swipe_right');7518 const swipeRight = currentMessage.find('.swipe_right');
7519 const swipeLeft = currentMessage.find('.swipe_left');7519 const swipeLeft = currentMessage.find('.swipe_left');
7520 const swipeCounter = currentMessage.find('.swipes-counter');7520 const swipeCounter = currentMessage.find('.swipes-counter');
@@ -8194,6 +8194,20 @@ window['SillyTavern'].getContext = function () {
8194 };8194 };
8195};8195};
81968196
8197/**
8198 * Formats a counter for a swipe view.
8199 * @param {number} current The current number of items.
8200 * @param {number} total The total number of items.
8201 * @returns {string} The formatted counter.
8202 */
8203function formatSwipeCounter(current, total) {
8204 if (isNaN(current) || isNaN(total)) {
8205 return '';
8206 }
8207
8208 return `${current}\u200b/\u200b${total}`;
8209}
8210
8197function swipe_left() { // when we swipe left..but no generation.8211function swipe_left() { // when we swipe left..but no generation.
8198 if (chat.length - 1 === Number(this_edit_mes_id)) {8212 if (chat.length - 1 === Number(this_edit_mes_id)) {
8199 closeMessageEditor();8213 closeMessageEditor();
public/scripts/slash-commands.js+1 -0
@@ -3612,6 +3612,7 @@ function getModelOptions(quiet) {
3612 { id: 'aphrodite_model', api: 'textgenerationwebui', type: textgen_types.APHRODITE },3612 { id: 'aphrodite_model', api: 'textgenerationwebui', type: textgen_types.APHRODITE },
3613 { id: 'ollama_model', api: 'textgenerationwebui', type: textgen_types.OLLAMA },3613 { id: 'ollama_model', api: 'textgenerationwebui', type: textgen_types.OLLAMA },
3614 { id: 'tabby_model', api: 'textgenerationwebui', type: textgen_types.TABBY },3614 { id: 'tabby_model', api: 'textgenerationwebui', type: textgen_types.TABBY },
3615 { id: 'featherless_model', api: 'textgenerationwebui', type: textgen_types.FEATHERLESS },
3615 { id: 'model_openai_select', api: 'openai', type: chat_completion_sources.OPENAI },3616 { id: 'model_openai_select', api: 'openai', type: chat_completion_sources.OPENAI },
3616 { id: 'model_claude_select', api: 'openai', type: chat_completion_sources.CLAUDE },3617 { id: 'model_claude_select', api: 'openai', type: chat_completion_sources.CLAUDE },
3617 { id: 'model_windowai_select', api: 'openai', type: chat_completion_sources.WINDOWAI },3618 { id: 'model_windowai_select', api: 'openai', type: chat_completion_sources.WINDOWAI },