Describe the bug
When using AudioCreateTranscriptionRequest() you can specify the ResponseFormat. If you specify a value other than Json or VerboseJson, and the call fails, then it doesn't correctly recognize the Error field. "Successful" will be true, but "Text" will show Json for an Error.
Your code piece
Using RunSimpleAudioCreateTranscriptionTest(), change to ResopnseFormat.Text. Then remove the extension from the Filename so that you will get an error back.
Result
audioResult.Successful incorrectly is true, and audioResult.Error is not set. In fact, in this case, the test throws an NullException since the call failed, but it goes into the "audioResult.Successful" branch. If you look at the audioResult.Text property:
{
"error": {
"message": "Timestamp granularities are only supported with response_format=verbose_json",
"type": "invalid_request_error",
"param": "timestamp_granularities",
"code": "timestamp_granularities_format"
}
}
Expected behavior
audioResult.Successful == false and audioResult.Error is set.
Additional context
I wonder if the library should not allow the user to set ResponseFormat to anything other than json.
I can confirm that this is a bug in the SDK. To solve this issue, we need to manage error messages for text response types, which I will address in the next update.
Describe the bug When using AudioCreateTranscriptionRequest() you can specify the ResponseFormat. If you specify a value other than Json or VerboseJson, and the call fails, then it doesn't correctly recognize the Error field. "Successful" will be true, but "Text" will show Json for an Error.
Your code piece Using RunSimpleAudioCreateTranscriptionTest(), change to ResopnseFormat.Text. Then remove the extension from the Filename so that you will get an error back.
Result audioResult.Successful incorrectly is true, and audioResult.Error is not set. In fact, in this case, the test throws an NullException since the call failed, but it goes into the "audioResult.Successful" branch. If you look at the audioResult.Text property:
Expected behavior audioResult.Successful == false and audioResult.Error is set.
Additional context I wonder if the library should not allow the user to set ResponseFormat to anything other than json.