-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Not as expected err: unexpected end of JSON input #280
Labels
bug
Something isn't working
Comments
sashabaranov
pushed a commit
that referenced
this issue
Apr 30, 2023
* Fix OpenAI or Azure returns an undefined error message return * Fix: OpenAI or Azure returns an undefined error message return #280 * Fix: OpenAI or Azure returns an undefined error message return #280 * Fix: OpenAI or Azure returns an undefined error message return #280 Handle long line * Fix: OpenAI or Azure returns an undefined error message return #280 Add unit test ErrorResponse nil pointer check * Fix: OpenAI or Azure returns an undefined error message return #280 Add unit test ErrorResponse nil pointer check --------- Co-authored-by: zhangxm <xuanming_zhang@qingsongchou.com>
Fixed #283 |
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When OpenAI or Azure returns an undefined error, since the JSON parsing meets the expectations of ErrorResponse, the "error, unexpected end of JSON input" error will be returned
client.go : line 134
func:handleErrorResp
The real error message cannot be captured , but errRes.Error can get the real error message.
Example Azure origin response body:
Calling “response, err := client.CreateChatCompletion()” gets “error, unexpected end of JSON input”,but unable to get correct error:Access denied due to Virtual Network/Firewall rules.
I think the correct error message can be obtained by modifying it in the following way:
Go Version:1.19.7
go-openai Version:1.9.0
The text was updated successfully, but these errors were encountered: