Merge pull request #1689 from Yidadaa/Yidadaa-patch-1

fix: #1688 wrong clear context index
This commit is contained in:
Yifei Zhang 2023-05-22 18:57:21 +08:00 committed by GitHub
commit bb0c3835f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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