openai-php / client

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

SOLVED: Add support for the "response_format"-param in a chat completion call #251

Closed axelbecher closed 8 months ago

axelbecher commented 8 months ago

Please add support for the "response_format"-param in a chat completion call, which currently leads to an exception: Unrecognized request argument supplied: response_format

axelbecher commented 8 months ago

OpenAI added it on the dev-day: https://platform.openai.com/docs/api-reference/chat/create

gehrisandro commented 8 months ago

Hi @axelbecher

According to the docs, this is a request-only attribute. So there should be nothing we have to change from our side. But maybe the docs are wrong.

Could you please provide an example of a failing request?

axelbecher commented 8 months ago

Hi @gehrisandro, indeed, you are correct, this Exception was generated on their side when requesting a "non-1106" model with this param. Sorry, I thought it's coming from the Client ;-) That's really an annoyance of the OpenAI API, they should make an endpoint with the capabilities, a model has (frame-size, supported response formats, trainability ...)