Using response_format in chat completion throws error

Thanks, but that throws the same error. It’s the reason I went down the path of trying response_format = ResponseFormat(type="json_object").

The issue seems to be that response_format isn’t recognized. It’s getting invalidated as an extra, unexpected field.