From c16896e96dc6579a461be06b363e788b3b618666 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 25 Dec 2024 22:23:59 -0800 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 9c1f11906..f22f4c4fc 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1065,8 +1065,10 @@ if (choices) { if (choices[0]?.message?.content) { + // Non-stream response message.content += choices[0]?.message?.content; } else { + // Stream response let value = choices[0]?.delta?.content ?? ''; if (message.content == '' && value == '\n') { console.log('Empty response');