mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-20 21:41:32 +01:00
Reinsert summary extension prompt instantly when changing position
This commit is contained in:
parent
5dd9a87dc9
commit
25d818ecbd
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user