Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Check that 'done' is not null in isDoneMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k committed Oct 17, 2023
1 parent afefa84 commit 3c862e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/llms/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export function isContentMessage(message: ChatCompletionsDelta): message is Cont

/** Return true if the message is a 'done' message. */
export function isDoneMessage(message: ChatCompletionsDelta): message is DoneMessage {
return 'done' in message;
return 'done' in message && message.done != null;
}

/** Return true if the response is an error response. */
Expand Down

0 comments on commit 3c862e3

Please sign in to comment.