Procházet zdrojové kódy

fix: historyMessageCount

Cesaryuan před 2 roky
rodič
revize
12f342f015
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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();