Merge branch 'Yidadaa:main' into main

This commit is contained in:
Hk-Gosuto
2023-08-14 23:20:31 +08:00
committed by GitHub
10 changed files with 63 additions and 6 deletions

View File

@@ -551,6 +551,7 @@ export const useChatStore = create<ChatStore>()(
},
summarizeSession() {
const config = useAppConfig.getState();
const session = get().currentSession();
// remove error messages if any
@@ -559,6 +560,7 @@ export const useChatStore = create<ChatStore>()(
// should summarize topic after chating more than 50 words
const SUMMARIZE_MIN_LEN = 50;
if (
config.enableAutoGenerateTitle &&
session.topic === DEFAULT_TOPIC &&
countMessages(messages) >= SUMMARIZE_MIN_LEN
) {