Skip to content

Commit ded36f5

Browse files
authored
Merge pull request #62 from langtail/fix-nullish-delta
handle possible nullish choice.delta value
2 parents ce122c6 + cebb847 commit ded36f5

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)