diff --git a/public/scripts/extensions/memory/index.js b/public/scripts/extensions/memory/index.js index 675507684..2a1b8b148 100644 --- a/public/scripts/extensions/memory/index.js +++ b/public/scripts/extensions/memory/index.js @@ -191,18 +191,21 @@ function onMemoryPromptInput() { function onMemoryTemplateInput() { const value = $(this).val(); extension_settings.memory.template = value; + reinsertMemory(); saveSettingsDebounced(); } function onMemoryDepthInput() { const value = $(this).val(); extension_settings.memory.depth = Number(value); + reinsertMemory(); saveSettingsDebounced(); } function onMemoryPositionChange(e) { const value = e.target.value; extension_settings.memory.position = value; + reinsertMemory(); saveSettingsDebounced(); } @@ -393,7 +396,7 @@ async function summarizeChatMain(context, force) { return; } - const summary = await generateQuietPrompt(prompt); + const summary = await generateQuietPrompt(prompt, false); const newContext = getContext(); // something changed during summarization request @@ -518,6 +521,11 @@ function onMemoryContentInput() { setMemoryContext(value, true); } +function reinsertMemory() { + const existingValue = $('#memory_contents').val(); + setMemoryContext(existingValue, false); +} + function setMemoryContext(value, saveToMessage) { const context = getContext(); context.setExtensionPrompt(MODULE_NAME, formatMemoryValue(value), extension_settings.memory.position, extension_settings.memory.depth);