fix: historyMessageCount

This commit is contained in:
Cesaryuan 2023-04-02 20:23:56 +08:00
parent fea4f561b4
commit 12f342f015

View File

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