diff --git a/public/scripts/extensions/infinity-context/index.js b/public/scripts/extensions/infinity-context/index.js index 6985cb51d..2bd03367b 100644 --- a/public/scripts/extensions/infinity-context/index.js +++ b/public/scripts/extensions/infinity-context/index.js @@ -76,6 +76,7 @@ async function loadSettings() { $('#chromadb_n_results').val(extension_settings.chromadb.n_results).trigger('input'); $('#chromadb_split_length').val(extension_settings.chromadb.split_length).trigger('input'); $('#chromadb_file_split_length').val(extension_settings.chromadb.file_split_length).trigger('input'); + $('#chromadb_freeze').prop('checked', extension_settings.chromadb.freeze); } function onStrategyChange() { @@ -119,6 +120,10 @@ function checkChatId(chat_id) { } async function addMessages(chat_id, messages) { + if (extension_settings.chromadb.freeze) { + return { count: 0 }; + } + const url = new URL(getApiUrl()); url.pathname = '/api/chromadb'; @@ -380,7 +385,7 @@ window.chromadb_interceptGeneration = async (chat) => { if (currentChatId) { const messagesToStore = chat.slice(0, -extension_settings.chromadb.keep_context); - if (messagesToStore.length > 0) { + if (messagesToStore.length > 0 || extension_settings.chromadb.freeze) { await addMessages(currentChatId, messagesToStore); const lastMessage = chat[chat.length - 1]; @@ -431,6 +436,11 @@ window.chromadb_interceptGeneration = async (chat) => { } } +function onFreezeInput() { + extension_settings.chromadb.freeze = $('#chromadb_freeze').is(':checked'); + saveSettingsDebounced(); +} + jQuery(async () => { const settingsHtml = `
@@ -454,6 +464,10 @@ jQuery(async () => { +