From 0a0e0bca1061ad676e069255124dac6a78f3d243 Mon Sep 17 00:00:00 2001 From: ccnetcore Date: Thu, 3 Jul 2025 21:28:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=96=87=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue b/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue index 9965f0ae..53dfa23c 100644 --- a/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue +++ b/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue @@ -177,7 +177,8 @@ async function startSSE(chatContent: string) { // content: item.content, // })), messages: bubbleItems.value - .slice(-6) // 直接取最后6条记录(最近的) + .slice(0, -1) // 去掉最后1条(即排除最新那条) + .slice(-6) // 然后取倒数第2到第7条(总共6条) .map((item: MessageItem) => ({ role: item.role, content: (item.role === 'ai' || item.role === 'system') && item.content.length > 2000