Skip to content

Remove null from streaming finishReason - #138

Merged
DybekK merged 2 commits into
softwaremill:masterfrom
guersam:fix-stream-finishreason
Nov 24, 2023
Merged

Remove null from streaming finishReason#138
DybekK merged 2 commits into
softwaremill:masterfrom
guersam:fix-stream-finishreason

Conversation

@guersam

@guersam guersam commented Nov 24, 2023

Copy link
Copy Markdown
Contributor

Currently, initial response chunks from chat completion emits null at choices[*].finishReason:

ChatChunkResponse(chatcmpl-8OGfnT5mmJwiTTmICOgi26fOxrJnf,List(Choices(Delta(Some(Assistant),Some(),None,None),null,0)),1700794655,gpt-4-1106-preview,chat.completion.chunk,Some(fp_a24b4d720c))
<FAIL>: Die(java.lang.NullPointerException: Cannot invoke "String.length()" because the return value of "sttp.openai.requests.completions.chat.ChatChunkRequestResponseData$Choices.finishReason()" is null,Stack trace for thread "zio-fiber-":
)

This PR makes it optional.

@guersam

guersam commented Nov 24, 2023

Copy link
Copy Markdown
Contributor Author

Just noticed that FunctionTollCall.id should be optional as well in streaming mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants