Open arshamalh opened 6 days ago
I'm willing to open a PR if the issue sounds reasonable.
Changing the AudioRequest to:
req := openai.AudioRequest{
Model: openai.Whisper1,
FilePath: "hashhashhash",
}
the file is a valid audio, but it's OGG that OpenAI doesn't support, the error I get is still from json package:
error, status code: 500, message: invalid character 'e' looking for beginning of value
but I expect to get something at least like the one server is returning:
error decoding MP3 file, make sure you send a valid MP3 file.
Describe the bug Trying to transcribe an mp3 file which happens to be larger than expected, using the snippet below:
the code returns this error:
OK, what is it all about? Is 413 an HTTP status code? where did '<' come from?
So I started to investigate, yep, 413 is an HTTP status code, but the error comes after it
message: invalid character '<' looking for beginning of value
, has nothing about the 413, and comes from json package which expects a json response.it's a little bit confusing. logging the error inside handleErrorResp method (
go-openai@v1.26.0/client.go:259
):Expected behavior I expected handleErrorResp returns a clear error like
Request Entity Too Large
before it tries to unmarshal an HTML, leading to a wrong second error.Environment (please complete the following information):
Additional context I don't exactly remember but I think I had the same issue with rate limit related errors earlier.