-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
json_object #126
Comments
Yes, it works great! I've been using this in all of my projects. Was super easy to use out of the box with this package. Although it's straight forward, might be worth adding an example to the README.md for others searching for the feature across PHP GitHub projects. Created a pull request: Adding PR here: $complete = $open_ai->chat([
'model' => 'gpt-3.5-turbo-1106',
'messages' => [
[
'role' => 'system',
'content' => 'You are a zoologist.'
],
[
'role' => 'system',
'content' => 'Respond with JSON. Use this structure: [{"animal":"","description":""}]'
],
[
'role' => 'user',
'content' => 'Supply a list of the most common animals you would see in a zoo.'
],
],
'temperature' => 1,
'max_tokens' => 3500,
'response_format' => [ 'type' => 'json_object' ]
]); |
Just a quick note for everyone whoe stumpled over this issue.
But
Have fun. |
Describe the feature or improvement you're requesting
Please, see at: https://platform.openai.com/docs/guides/text-generation/json-mode
Additional context
No response
The text was updated successfully, but these errors were encountered: