mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 21:44:59 +08:00
fix: conflict
This commit is contained in:
@@ -407,13 +407,16 @@ export const useChatStore = create<ChatStore>()(
|
||||
summarizeSession() {
|
||||
const session = get().currentSession();
|
||||
|
||||
// remove error messages if any
|
||||
const cleanMessages = session.messages.filter((msg) => !msg.isError);
|
||||
|
||||
// should summarize topic after chating more than 50 words
|
||||
const SUMMARIZE_MIN_LEN = 50;
|
||||
if (
|
||||
session.topic === DEFAULT_TOPIC &&
|
||||
countMessages(session.messages) >= SUMMARIZE_MIN_LEN
|
||||
countMessages(cleanMessages) >= SUMMARIZE_MIN_LEN
|
||||
) {
|
||||
const topicMessages = session.messages.concat(
|
||||
const topicMessages = cleanMessages.concat(
|
||||
createMessage({
|
||||
role: "user",
|
||||
content: Locale.Store.Prompt.Topic,
|
||||
@@ -435,7 +438,7 @@ export const useChatStore = create<ChatStore>()(
|
||||
}
|
||||
|
||||
const modelConfig = session.mask.modelConfig;
|
||||
let toBeSummarizedMsgs = session.messages.slice(
|
||||
let toBeSummarizedMsgs = cleanMessages.slice(
|
||||
session.lastSummarizeIndex,
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user