Merge branch 'staging' into tool-calling

c3e9d253077843a615511a067347a8237805e057

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

2 files changed, +17 -2Ignore whitespace
public/script.js+16 -2
@@ -2373,7 +2373,7 @@ export function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll
23732373 if (!params.isUser && newMessageId !== 0 && newMessageId !== chat.length - 1) {
23742374 const swipesNum = chat[newMessageId].swipes?.length;
23752375 const swipeId = chat[newMessageId].swipe_id + 1;
23762376 newMessage.find('.swipes-counter').text(`${formatSwipeCounter(swipeId}\u200B/\u200b${, swipesNum}`));
23772377 }
23782378
23792379 if (showSwipes) {
@@ -7514,7 +7514,7 @@ export function showSwipeButtons() {
75147514
75157515 const currentMessage = $('#chat').children().filter(`[mesid="${chat.length - 1}"]`);
75167516 const swipeId = chat[chat.length - 1].swipe_id;
75177517 const swipeCounterText = formatSwipeCounter(`${(swipeId + 1)}\u200B/\u200b${(, chat[chat.length - 1].swipes.length)}`);
75187518 const swipeRight = currentMessage.find('.swipe_right');
75197519 const swipeLeft = currentMessage.find('.swipe_left');
75207520 const swipeCounter = currentMessage.find('.swipes-counter');
@@ -8194,6 +8194,20 @@ window['SillyTavern'].getContext = function () {
81948194 };
81958195};
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+ */
8203+function formatSwipeCounter(current, total) {
8204+ if (isNaN(current) || isNaN(total)) {
8205+ return '';
8206+ }
8207+
8208+ return `${current}\u200b/\u200b${total}`;
8209+}
8210+
81978211function swipe_left() { // when we swipe left..but no generation.
81988212 if (chat.length - 1 === Number(this_edit_mes_id)) {
81998213 closeMessageEditor();
public/scripts/slash-commands.js+1 -0
@@ -3612,6 +3612,7 @@ function getModelOptions(quiet) {
36123612 { id: 'aphrodite_model', api: 'textgenerationwebui', type: textgen_types.APHRODITE },
36133613 { id: 'ollama_model', api: 'textgenerationwebui', type: textgen_types.OLLAMA },
36143614 { id: 'tabby_model', api: 'textgenerationwebui', type: textgen_types.TABBY },
3615+ { id: 'featherless_model', api: 'textgenerationwebui', type: textgen_types.FEATHERLESS },
36153616 { id: 'model_openai_select', api: 'openai', type: chat_completion_sources.OPENAI },
36163617 { id: 'model_claude_select', api: 'openai', type: chat_completion_sources.CLAUDE },
36173618 { id: 'model_windowai_select', api: 'openai', type: chat_completion_sources.WINDOWAI },