forked from XiaoMo/ChatGPT-Next-Web
remove error messages in toBeSummarizedMsgs
This commit is contained in:
parent
d9be63e6cb
commit
a9f000e7ef
@ -423,7 +423,10 @@ export const useChatStore = create<ChatStore>()(
|
||||
let toBeSummarizedMsgs = session.messages.slice(
|
||||
session.lastSummarizeIndex,
|
||||
);
|
||||
|
||||
|
||||
// remove error messages if any
|
||||
toBeSummarizedMsgs = toBeSummarizedMsgs.filter((msg) => !msg.isError);
|
||||
|
||||
const historyMsgLength = countMessages(toBeSummarizedMsgs);
|
||||
|
||||
if (historyMsgLength > modelConfig?.max_tokens ?? 4000) {
|
||||
|
Loading…
Reference in New Issue
Block a user