openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.56k stars 466 forks source link

[Bug]: JSON format is not supported #371

Closed htuzel closed 2 months ago

htuzel commented 2 months ago

Description

I tried to use JSON format response but it doesn't work

Steps To Reproduce

Create a request like that:

    $result = $client->chat()->create([
        'model' => 'gpt-4-1106-preview',
        'response_format' => [ 'type' => 'json_format' ],
        'messages' => [
            ['role' => 'user', 'content' => $content],
        ],

    ]);

OpenAI PHP Client Version

0.8.4

PHP Version

8.3.3

Notes

No response