Open marcocanestrari opened 4 months ago
It appears to me, OpenAI currently returns
[error] => Array
(
[error] =>
)
When everything worked fine and a real error still looks like
[error] => Array
(
[code] => '12345'
[message] => 'Bla'
...
)
Description
On line 70 in /Responses/FineTuning/RetriveJobResponse.php
$attributes['error']
is checked assuming it's empty if there are no errors. If there are errors,RetrieveJobResponseError::from($attributes['error'])
is added to the array.isset($attributes['error']) ? RetrieveJobResponseError::from($attributes['error']) : 'null',
Apparently, OpenAI has changed the response to
The line should be updated to
isset($attributes['error']['error']) ? RetrieveJobResponseError::from($attributes['error']['error']) : 'null',
I'd do it myself and push a PR but I'm new with OpenAI APIs, and since this started yesterday after an outage, it could only be a bug from their ends that will get fixed soon.
What do you all think?
Steps To Reproduce
Call
$client->fineTuning()->listJobs();
An error should get thrown:
Fatal error: Uncaught Error: OpenAI\Responses\FineTuning\RetrieveJobResponseError::__construct(): Argument #1 ($code) must be of type string, null given, called in
OpenAI PHP Client Version
v0.8.4
PHP Version
8.3.0
Notes
No response