Skip to content

Commit cebb847

Browse files
committed
handle possible nullish choice.delta value
1 parent ce122c6 commit cebb847

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/react/useChatStream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function combineAIMessageChunkWithCompleteMessages(
8181
})
8282

8383
const choicesDeltas = chunk.choices.filter((choice) => {
84-
return "delta" in choice
84+
return "delta" in choice && choice.delta // NOTE: delte can be null
8585
})
8686

8787
if (!existingMessageToComplete && choicesDeltas.length > 0) {

0 commit comments

Comments
 (0)