Skip to content

[Bug]: Undefined array key "outputs" when using code interpreter on a thread #412

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

Closed
KaracsonyMarton opened this issue May 27, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@KaracsonyMarton
Copy link

Description

Undefined array key "outputs" Error

Description:
An Undefined array key "outputs" error occurs when running the OpenAI PHP client. This issue appears to be related to the response handling in the ThreadRunStepResponseCodeInterpreter.php file.

Error Log:

[2024-05-27 21:55:06] local.ERROR: Undefined array key "outputs" {"userId":1,"exception":"[object] (ErrorException(code: 0): Undefined array key "outputs" at /var/www/html/vendor/openai-php/client/src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeInterpreter.php:44)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/html/vendor/openai-php/client/src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeInterpreter.php(44): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 /var/www/html/vendor/openai-php/client/src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeToolCall.php(43): OpenAI\Responses\Threads\Runs\Steps\ThreadRunStepResponseCodeInterpreter::from()
#3 /var/www/html/vendor/openai-php/client/src/Responses/Threads/Runs/Steps/ThreadRunStepResponseToolCallsStepDetails.php(42): OpenAI\Responses\Threads\Runs\Steps\ThreadRunStepResponseCodeToolCall::from()
#4 [internal function]: OpenAI\Responses\Threads\Runs\Steps\ThreadRunStepResponseToolCallsStepDetails::OpenAI\Responses\Threads\Runs\Steps\{closure}()
#5 /var/www/html/vendor/openai-php/client/src/Responses/Threads/Runs/Steps/ThreadRunStepResponseToolCallsStepDetails.php(40): array_map()
#6 /var/www/html/vendor/openai-php/client/src/Responses/Threads/Runs/Steps/Delta/ThreadRunStepDeltaObject.php(39): OpenAI\Responses\Threads\Runs\Steps\ThreadRunStepResponseToolCallsStepDetails::from()
#7 /var/www/html/vendor/openai-php/client/src/Responses/Threads/Runs/Steps/Delta/ThreadRunStepDeltaResponse.php(40): OpenAI\Responses\Threads\Runs\Steps\Delta\ThreadRunStepDeltaObject::from()
#8 /var/www/html/vendor/openai-php/client/src/Responses/Threads/Runs/ThreadRunStreamResponse.php(63): OpenAI\Responses\Threads\Runs\Steps\Delta\ThreadRunStepDeltaResponse::from()
#9 /var/www/html/vendor/openai-php/client/src/Responses/StreamResponse.php(68): OpenAI\Responses\Threads\Runs\ThreadRunStreamResponse::from()

Environment:

  • PHP version: 8.3.6
  • OpenAI PHP Client version: v.0.9.2

Please let me know if further information is required or if there are any suggestions to resolve this issue. Thank you!

Steps To Reproduce

Steps to Reproduce:

  1. Enable the code interpreter on an assistant.
  2. Ask the assistant to create any file.
  3. Observe the error log for the Undefined array key "outputs" message.
  4. If the code interpreter is turned off, everything works perfectly.

OpenAI PHP Client Version

v.0.9.2

PHP Version

8.3.6

Notes

No response

@KaracsonyMarton KaracsonyMarton added the bug Something isn't working label May 27, 2024
@gehrisandro
Copy link
Collaborator

@KaracsonyMarton
Copy link
Author

Awesome, thanks!

When do you think it will go from pre release to release?

@gehrisandro
Copy link
Collaborator

Depending on the feedback. Probably by the end of this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants