-
-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Warning: Undefined array key "code" in Responses/FineTuning/RetrieveJobResponseError.php on line 42 #362
Comments
I created a PR with a fix for this issue: #363 |
Here is how you can create a completely new install that recreates this error. I have also included the fix
Paste this:
Error Response:
Fix:Inside file src\Responses\FineTuning\RetrieveJobResponseError.phpChange:
To:
Change:
To:
|
thank you for the solution @BrainPackIO |
Will these fixes get merged? |
can these be merged please! this would help me a lot :D |
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
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:
The text was updated successfully, but these errors were encountered: