The OpenAI docs descripe a response_format of type json_object when using gpt-3.5-turbo-1106 or newer. This does not seem to work with the PHP client. I am using 'response_format' => '{"type": "json_object"}' as described in the docs, and have the required 'respond with json' in the message. I get the 'json_object' is not of type 'object' - 'response_format' error.
#JSON Response Format using github.com/openai-php/laravel
13 messages · Page 1 of 1 (latest)
Why are you not just using the facade? If you're not taking advantage of that, then don't use the laravel package...
If you are just interfacing with the openai-php client and not using the facades etc, then having extra packages is pointless You don't HAVE to use a package just because it has the "laravel" name in it, you can use the openai-php client directly instead
I am using the facade, this is variable in the message component of OpenAI::chat()->create().
There is zero reference to response_format = 'json_object' that I can see, 'verbose_json' is an option
verbose_json is for the voice api call
Right, where have you seen "json_object" as "response_format" in the docs?
And I'm talking the PHP Client, not the official API docs
I am asking if it is supported or if anyone has used the json support, it's not in the docs.