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