I got the same error, apparently this seems to be the only endpoint that supports structured outputs for now. Tried batch, assistants as well as completions and it doesn’t support despite latest SDK
It works with Python 3.10. after upgrading openai to 1.43.0. Keep in mind that you have to restart the kernel after pip install, if you’re using Jupyter notebook.
If you want to keep an old Python version such as Python 3.9, use pip install openai==1.47.0 --upgrade. Then, use pip freeze to double-check that the right version was installed.
Python on the bleeding edge that is not in the bugfix stage is not recommended, though, unless you have strong justification. You may inadvertently use a method that breaks backwards-compatibility, causing the same issues for others.
Here’s what one can do for assurance that you are working with the same platform as a developer might, or simulate a brand new Python install that just had installed a pypi module fresh: upgrade ALL the openai dependencies to the latest supported.
For upgrading all, by current version limitations of OpenAI requirements:
The above progresses from lower level dependencies, so a later module version with updated requirements could override what was just installed before. Only as a side effect, it addresses any version concerns about using “openai.Client().beta”