-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
v1.28.0 breaks API requests that specify a response format without a JSONSchema #818
Comments
Tagging @eiixy as the original author of the breaking PR. |
@gspeicher see #820. Meanwhile if you want to get started using the new api before this gets merged, you can use my fork. Just update your go.mod to use the following
|
Thanks, @tylergannon! While you're in there, maybe you can check out my note in #813 about changing the definition of the
My hope is that we can change the type of
but explicitly defining |
I am also having this problem, is there any fix to it yet or the only option is to not use the response format? I really need to use the structured return because I tried structuring the return just by prompt but it kept returning me with ```json tags before and after the json object and I couldn't find a way to extract the json from it. |
I had a problem with this today. |
Describe the bug
The addition of the
JSONSchema
field to typeChatCompletionResponseFormat
has broken API requests that specifyResponseFormat
asopenai.ChatCompletionResponseFormatTypeJSONObject
.To Reproduce
Expected behavior
API requests should continue to work as before.
Screenshots/Logs
The API is responding with:
Environment (please complete the following information):
Additional context
The problem is that
omitempty
does not respect the empty value forJSONSchema
field since it is defined as a non-pointer type. If it is defined instead as a pointer toChatCompletionResponseFormatJSONSchema
then it will be correcly omitted from the marshaled JSON when not in use.The text was updated successfully, but these errors were encountered: