Skip to content

Commit 8753070

Browse files
committed
server: fix web UI access of final chunk with empty choices array
1 parent 5682a37 commit 8753070

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/server/webui/src/utils/app.context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export const AppContextProvider = ({
255255
if (chunk.error) {
256256
throw new Error(chunk.error?.message || 'Unknown error');
257257
}
258-
const addedContent = chunk.choices[0].delta.content;
258+
const addedContent = chunk.choices?.[0].delta.content;
259259
const lastContent = pendingMsg.content || '';
260260
if (addedContent) {
261261
pendingMsg = {

0 commit comments

Comments
 (0)