You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
err:=json.NewDecoder(resp.Body).Decode(&errRes)
The real error message cannot be captured , but errRes.Error can get the real error message.
Example Azure origin response body:
{
"error":{
"code":"AccessDenied",
"message":"Access denied due to Virtual Network/Firewall rules."
}
}
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:
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: