fix: #1688 wrong clear context index

This commit is contained in:
Yifei Zhang 2023-05-22 18:56:19 +08:00 committed by GitHub
parent f0b4ef5917
commit e9642c7505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -345,7 +345,7 @@ export const useChatStore = create<ChatStore>()(
// wont send cleared context messages
const clearedContextMessages = session.messages.slice(
(session.clearContextIndex ?? -1) + 1,
(session.clearContextIndex ?? 0),
);
const messages = clearedContextMessages.filter((msg) => !msg.isError);
const n = messages.length;