Pārlūkot izejas kodu

fix: historyMessageCount

Cesaryuan 2 gadi atpakaļ
vecāks
revīzija
12f342f015
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      app/store/app.ts

+ 1 - 1
app/store/app.ts

@@ -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();