From bf614068c035e43a564949da1b879f37392bd259 Mon Sep 17 00:00:00 2001 From: Yanyutin753 <132346501+Yanyutin753@users.noreply.github.com> Date: Wed, 22 May 2024 09:35:59 +0800 Subject: [PATCH] feat make stronger --- src/lib/components/chat/Chat.svelte | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 3c6ec9eb8..871647101 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -425,8 +425,7 @@ : undefined, ...messages ] - .filter((message) => message) - .filter((message) => message.content != '') + .filter((message) => message?.content?.trim()) .map((message, idx, arr) => { // Prepare the base message object const baseMessage = { @@ -686,8 +685,7 @@ : undefined, ...messages ] - .filter((message) => message) - .filter((message) => message.content != '') + .filter((message) => message?.content?.trim()) .map((message, idx, arr) => ({ role: message.role, ...((message.files?.filter((file) => file.type === 'image').length > 0 ?? false) &&