openai-php / client

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

Changed type of the description prop to nullable #484

Closed smskin closed 2 weeks ago

smskin commented 1 month ago

What:

Description:

The description property of \OpenAI\Responses\Assistants\AssistantResponseToolFunctionFunction is nullable.

When creating an assistant with a function that does not have a description specified, I received an error:

OpenAI\Responses\Assistants\AssistantResponseToolFunctionFunction::__construct(): Argument #1 ($description) must be of type string, null given, called in /var/www/html/vendor/openai-php/client/src/Responses/Assistants/AssistantResponseToolFunctionFunction.php on line 40

OpenAI documentation: https://platform.openai.com/docs/api-reference/assistants/createAssistant

Exception Exception

Source of response Source of response

Screenshot of documentation Screenshot of documentation

smskin commented 1 month ago

This PR is a copy of PR 483. I recreated it to stop using the main branch

gehrisandro commented 2 weeks ago

Thanks, @smskin for the PR!