Merge branch 'staging' into tool-calling
| @@ -2373,7 +2373,7 @@ export function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll | ||
| 2373 | 2373 | if (!params.isUser && newMessageId !== 0 && newMessageId !== chat.length - 1) { |
| 2374 | 2374 | const swipesNum = chat[newMessageId].swipes?.length; |
| 2375 | 2375 | const swipeId = chat[newMessageId].swipe_id + 1; |
| 2376 | 2376 | newMessage.find('.swipes-counter').text(`${formatSwipeCounter(swipeId}\u200B/\u200b${, swipesNum}`)); |
| 2377 | 2377 | } |
| 2378 | 2378 | |
| 2379 | 2379 | if (showSwipes) { |
| @@ -7514,7 +7514,7 @@ export function showSwipeButtons() { | ||
| 7514 | 7514 | |
| 7515 | 7515 | const currentMessage = $('#chat').children().filter(`[mesid="${chat.length - 1}"]`); |
| 7516 | 7516 | const swipeId = chat[chat.length - 1].swipe_id; |
| 7517 | 7517 | const swipeCounterText = formatSwipeCounter(`${(swipeId + 1)}\u200B/\u200b${(, chat[chat.length - 1].swipes.length)}`); |
| 7518 | 7518 | const swipeRight = currentMessage.find('.swipe_right'); |
| 7519 | 7519 | const swipeLeft = currentMessage.find('.swipe_left'); |
| 7520 | 7520 | const swipeCounter = currentMessage.find('.swipes-counter'); |
| @@ -8194,6 +8194,20 @@ window['SillyTavern'].getContext = function () { | ||
| 8194 | 8194 | }; |
| 8195 | 8195 | }; |
| 8196 | 8196 | |
| 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 | + | |
| 8197 | 8211 | function swipe_left() { // when we swipe left..but no generation. |
| 8198 | 8212 | if (chat.length - 1 === Number(this_edit_mes_id)) { |
| 8199 | 8213 | closeMessageEditor(); |
| @@ -3612,6 +3612,7 @@ function getModelOptions(quiet) { | ||
| 3612 | 3612 | { id: 'aphrodite_model', api: 'textgenerationwebui', type: textgen_types.APHRODITE }, |
| 3613 | 3613 | { id: 'ollama_model', api: 'textgenerationwebui', type: textgen_types.OLLAMA }, |
| 3614 | 3614 | { id: 'tabby_model', api: 'textgenerationwebui', type: textgen_types.TABBY }, |
| 3615 | + { id: 'featherless_model', api: 'textgenerationwebui', type: textgen_types.FEATHERLESS }, | |
| 3615 | 3616 | { id: 'model_openai_select', api: 'openai', type: chat_completion_sources.OPENAI }, |
| 3616 | 3617 | { id: 'model_claude_select', api: 'openai', type: chat_completion_sources.CLAUDE }, |
| 3617 | 3618 | { id: 'model_windowai_select', api: 'openai', type: chat_completion_sources.WINDOWAI }, |