mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
#866 Wait for group to stop generating before auto-summarizing
This commit is contained in:
parent
f892931d44
commit
2a153e3b15
@ -1,6 +1,7 @@
|
|||||||
import { getStringHash, debounce, waitUntilCondition, extractAllWords } from "../../utils.js";
|
import { getStringHash, debounce, waitUntilCondition, extractAllWords } from "../../utils.js";
|
||||||
import { getContext, getApiUrl, extension_settings, doExtrasFetch, modules } from "../../extensions.js";
|
import { getContext, getApiUrl, extension_settings, doExtrasFetch, modules } from "../../extensions.js";
|
||||||
import { eventSource, event_types, extension_prompt_types, generateQuietPrompt, is_send_press, saveSettingsDebounced, substituteParams } from "../../../script.js";
|
import { eventSource, event_types, extension_prompt_types, generateQuietPrompt, is_send_press, saveSettingsDebounced, substituteParams } from "../../../script.js";
|
||||||
|
import { is_group_generating, selected_group } from "../../group-chats.js";
|
||||||
export { MODULE_NAME };
|
export { MODULE_NAME };
|
||||||
|
|
||||||
const MODULE_NAME = '1_memory';
|
const MODULE_NAME = '1_memory';
|
||||||
@ -333,6 +334,10 @@ async function summarizeChat(context) {
|
|||||||
|
|
||||||
async function summarizeChatMain(context, force) {
|
async function summarizeChatMain(context, force) {
|
||||||
try {
|
try {
|
||||||
|
// Wait for group to finish generating
|
||||||
|
if (selected_group) {
|
||||||
|
await waitUntilCondition(() => is_group_generating === false, 1000, 10);
|
||||||
|
}
|
||||||
// Wait for the send button to be released
|
// Wait for the send button to be released
|
||||||
waitUntilCondition(() => is_send_press === false, 30000, 100);
|
waitUntilCondition(() => is_send_press === false, 30000, 100);
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user