Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChatChoice finish_reason can be null #46

Merged
merged 1 commit into from
Mar 4, 2023

Conversation

ming08108
Copy link
Contributor

finish_reason can sometimes be null in CreateChatCompletionResponse.

@64bit
Copy link
Owner

64bit commented Mar 3, 2023

Hi @ming08108 , thank you for PR.

Is this always the case or its intermittent?

In my testing I did not observe that otherwise examples/chat would have crashed gotten deserialization error .

One exception is Chat API with SSE streaming, where I did notice it to be null, which is already an Option<String> here https://github.com/64bit/async-openai/blob/main/async-openai/src/types/types.rs#L803

@jonaro00
Copy link
Contributor

jonaro00 commented Mar 4, 2023

@64bit I am also getting null on this field. In my case, the chance seems to be around 1 in 15.

@zurawiki
Copy link
Contributor

zurawiki commented Mar 4, 2023

+1 this is happening for me too

@ming08108
Copy link
Contributor Author

Hi @ming08108 , thank you for PR.

Is this always the case or its intermittent?

In my testing I did not observe that otherwise examples/chat would have crashed gotten deserialization error .

One exception is Chat API with SSE streaming, where I did notice it to be null, which is already an Option<String> here https://github.com/64bit/async-openai/blob/main/async-openai/src/types/types.rs#L803

Seems to be intermittent/random.

Some other reports of it here:
openai-php/client#50
openai-php/client#52

@64bit
Copy link
Owner

64bit commented Mar 4, 2023

aha, that's no good, lets ship this

@64bit 64bit merged commit 411ae1e into 64bit:main Mar 4, 2023
@64bit
Copy link
Owner

64bit commented Mar 4, 2023

Its released in 0.9.0. Thank you everyone

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.

None yet

4 participants