From b4aecc9a098acba27d41a04e4b4fcd5f118e97a2 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Thu, 18 May 2023 22:05:24 +0800 Subject: [PATCH] refactor(ai): limit latest 30 item to summary --- client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx b/client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx index 4ec5b512..5fe7455c 100644 --- a/client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx +++ b/client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx @@ -143,7 +143,7 @@ export const AssistantPopover: React.FC<{ const plainMessages = ( await Promise.all( messages - .slice(0, 30) // get first 30 message, too much will throw error + .slice(messages.length - 30, messages.length) // get last 30 message, too much will throw error .map( async (item) => `${