Skip to content
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

OpenAI \ Exceptions \ ErrorException - unclear, please help #47

Closed
nezaboravi opened this issue Jun 1, 2023 · 8 comments
Closed
Assignees

Comments

@nezaboravi
Copy link

I am attaching image of screen.
Error is unclear, and i am not sure where to look at all

image

Pest test works:
carbon(1)

@kmilo2622
Copy link

kmilo2622 commented Jun 1, 2023

Since yesterday this is happening with no further explanation, before yesterday everything was fine; this is the error i'm getting in Laravel 9

image

@gehrisandro
Copy link
Collaborator

This has been fixed in the latest version: 0.5.3

@Obacm
Copy link

Obacm commented Jun 13, 2023

Me too

@makerstorage
Copy link

Same here. Please check still exist in version: 0.5.3

@gehrisandro
Copy link
Collaborator

I've tried various things, but I am not able to reproduce the issue.

@nezaboravi @kmilo2622 @Obacm @makerstorage Was anyone of you able to debug an find out, what the API actually returns or do you have a stable way to reproduce the issue?

@gehrisandro
Copy link
Collaborator

Probably I run into the same issue right now:

For some error the API returns an error with an empty message, which leads to some confusion. If you are taking a closer look to the error exception details, the reason is visible, but this some kind of unexpected.

Exception Output:
Screenshot 2023-06-14 at 21 52 28

Raw JSON error from the API:
Screenshot 2023-06-14 at 21 54 14

Maybe would could add some logic, like "if the message is empty copy the error code to the message".
What do you think?

At least for the invalid API Key this doesn't look to bad:
Screenshot 2023-06-14 at 21 58 49

@gehrisandro gehrisandro reopened this Jun 14, 2023
@gehrisandro gehrisandro self-assigned this Jun 14, 2023
@kmilo2622
Copy link

kmilo2622 commented Jun 15, 2023

I could find out the error using the openAI API directly and it was a problem with the API key (in my situation) but that error wasn't available for debug in this PHP package for some reason.

@nezaboravi
Copy link
Author

nezaboravi commented Jun 15, 2023

Problem here lays in env variable naming.
min openai is actually two similar things, one is called display name and other is called id. In env file in laravel mislead me kind of so I wrote Coding Wisely as organisation name, and when I removed it and changed to organisation id provided in openai, it worked. Maybe just update environment name to be clear that that is ID

Here is what i am talking about:
OPENAI_ORGANIZATION=
I would rename it to OPENAI_ORGANIZATION_ID and point user where to get it.

In openAI you have both open organization and open organization id that starts with org-....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants