Skip to content

[Bug]: Warning: Undefined array key "code" in Responses/FineTuning/RetrieveJobResponseError.php on line 42 #362

Closed
@alek-s-andr

Description

@alek-s-andr

Description

A am getting the error when run any method on the $openAIClient->fineTuning() endpoint, for example $openAIClient->fineTuning()->createJob($params);.
This run leads to fatal error:
PHP Fatal error: Uncaught TypeError: OpenAI\Responses\FineTuning\RetrieveJobResponseError::__construct(): Argument #1 ($code) must be of type string, null given, called in vendor/openai-php/client/src/Responses/FineTuning/RetrieveJobResponseError.php on line 37 and defined in vendor/openai-php/client/src/Responses/FineTuning/RetrieveJobResponseError.php:20

2024-03-29-13-14-15

Steps To Reproduce

Run $openAIClient->fineTuning()->retrieveJob('ftjob-...');

OpenAI PHP Client Version

v0.8.4

PHP Version

8.1.27

Notes

https://platform.openai.com/docs/api-reference/fine-tuning/object
I did a little research and found out that the returned fine-tuning job object from OpenAI API actually contains the parameter error which contains other object with key error (but this is not mentioned in the OpenAI documentation) in the absence of an error:

2024-03-29-12-44-08

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions