From 47af34c0619364cb5d258a559616a50f59b5c891 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Fri, 25 Aug 2023 19:17:36 +0800 Subject: [PATCH] fix whisper join --- src/chatbox.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/chatbox.tsx b/src/chatbox.tsx index 2bbd917..90632be 100644 --- a/src/chatbox.tsx +++ b/src/chatbox.tsx @@ -525,14 +525,15 @@ export default function ChatBOX(props: { } // build prompt - const prompt = - chatStore.history - .filter(({ hide }) => !hide) - .slice(chatStore.postBeginIndex) - .map(({ content }) => content) - .join(" ") + - " " + - inputMsg; + const prompt = [chatStore.systemMessageContent] + .concat( + chatStore.history + .filter(({ hide }) => !hide) + .slice(chatStore.postBeginIndex) + .map(({ content }) => content) + ) + .concat([inputMsg]) + .join(" "); console.log({ prompt }); setIsRecording("Recording");