|
|
@ -424,6 +424,9 @@ export const useChatStore = create<ChatStore>()(
|
|
|
|
session.lastSummarizeIndex,
|
|
|
|
session.lastSummarizeIndex,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// remove error messages if any
|
|
|
|
|
|
|
|
toBeSummarizedMsgs = toBeSummarizedMsgs.filter((msg) => !msg.isError);
|
|
|
|
|
|
|
|
|
|
|
|
const historyMsgLength = countMessages(toBeSummarizedMsgs);
|
|
|
|
const historyMsgLength = countMessages(toBeSummarizedMsgs);
|
|
|
|
|
|
|
|
|
|
|
|
if (historyMsgLength > modelConfig?.max_tokens ?? 4000) {
|
|
|
|
if (historyMsgLength > modelConfig?.max_tokens ?? 4000) {
|
|
|
|