-
Notifications
You must be signed in to change notification settings - Fork 328
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
Mark finish_reason
and other properties as required
#60
Conversation
Attempts to resolve openai/openai-node#82 Note I am very uncertain whether these changes are correct; they are just guesses. Please audit them before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting a few things I was particularly unsure of.
@@ -2155,6 +2159,8 @@ components: | |||
type: array | |||
items: | |||
type: object | |||
required: | |||
- index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I assume that index
would always be present, but delta
and finish_reason
may not be here; I have not checked whether that tends to be the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delta
and finish_reason
are also always present, we can make this required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, then presumably finish_reason
should be marked as nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And is delta
nullable, or would it be ''
on the last chunk when it's just a finish reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finish_reason is nullable, whereas delta is always a dictionary with every key (and sub key) optional.
openapi.yaml
Outdated
required: | ||
- text | ||
- index | ||
- logprobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if the logprobs
key would always be present; it is marked as nullable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug — the v1/edits
response doesn't support logprobs
as a parameter or a response field. Can we remove from both request and response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting a few things I was particularly unsure of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of fixes, thanks for doing this!
Thanks Atty! Back to you – want to make sure we get the typing around |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarified about delta / finish_reason
Attempts to resolve openai/openai-node#82
Note I am very uncertain whether these changes are correct; they are just guesses. Please audit them before merging.