Structured Output 'Beta' object has no attribute 'chat'

AttributeError: ‘Beta’ object has no attribute ‘chat’

I am having trouble with the structured output API how to fix?

1 Like

Hi, welcome to the developer community.

Could you add a little more context please?

1 Like

It is possible that you are using an older OpenAI SDK library than is required.

To employ the examples shown in the GitHub repository for beta helper methods, such as “client.beta.chat.completions.parse()” when using a Pydantic BaseModel class as a response_format, you must also be running today’s version of library code that will accept the new parameters and methods and send them to the API.

or Node.js:

2 Likes