Merge pull request #355 from cesaryuan/patch-1

fix: fix history message count
This commit is contained in:
Yifei Zhang
2023-04-02 21:42:46 +08:00
committed by GitHub

View File

@@ -386,7 +386,7 @@ export const useChatStore = create<ChatStore>()(
const config = get().config;
const n = session.messages.length;
const recentMessages = session.messages.slice(
n - config.historyMessageCount,
Math.max(0, n - config.historyMessageCount),
);
const memoryPrompt = get().getMemoryPrompt();