Skip to content

Commit

Permalink
openai-php#362 Fix for the error key in RetrieveJobResponseError in F…
Browse files Browse the repository at this point in the history
…ine-Tuning
  • Loading branch information
alek-s-andr committed Mar 29, 2024
1 parent 38fb90e commit 3a93457
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Responses/FineTuning/RetrieveJobResponseError.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ private function __construct(
*/
public static function from(array $attributes): ?self
{
if (key_exists('error', $attributes) && is_null($attributes['error'])) {
return null;
}

return new self(
$attributes['code'],
$attributes['param'],
Expand Down

0 comments on commit 3a93457

Please sign in to comment.