diff --git a/public/scripts/extensions/infinity-context/index.js b/public/scripts/extensions/infinity-context/index.js index 6e42b97c0..3217d4654 100644 --- a/public/scripts/extensions/infinity-context/index.js +++ b/public/scripts/extensions/infinity-context/index.js @@ -92,6 +92,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() { @@ -135,6 +136,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'; @@ -396,7 +401,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]; @@ -447,6 +452,11 @@ window.chromadb_interceptGeneration = async (chat) => { } } +function onFreezeInput() { + extension_settings.chromadb.freeze = $('#chromadb_freeze').is(':checked'); + saveSettingsDebounced(); +} + jQuery(async () => { const settingsHtml = `
@@ -470,6 +480,10 @@ jQuery(async () => { +