diff --git a/src/chatbox.tsx b/src/chatbox.tsx index c81c00c..3462f83 100644 --- a/src/chatbox.tsx +++ b/src/chatbox.tsx @@ -84,6 +84,10 @@ export default function ChatBOX(props: { for await (const i of client.processStreamResponse(response)) { chatStore.responseModelName = i.model; responseTokenCount += 1; + + // skip if choice is empty (e.g. azure) + if (!i.choices[0]) continue; + allChunkMessage.push(i.choices[0].delta.content ?? ""); const tool_calls = i.choices[0].delta.tool_calls; if (tool_calls) { @@ -692,7 +696,7 @@ export default function ChatBOX(props: { {chatStore.history.length > 0 && (