Open usagimaru opened 7 months ago
func audioTranscriptions(
query: AudioTranscriptionQuery
) async throws -> AudioTranscriptionResult {
incorrectly throws JSON decoding error for AudioResponseFormat.srt
we could not use other formats as we need time codes
Describe the bug
I have tested the behavior of new
response_format
parameter implemented with #114. However, my frontend code always returned a JSON decoding error.I traced from the breakpoint and found that it catches the error at this line in the method
performRequest<ResultType: Codable>()
ofOpenAI.swift
. Errors seems to occur when anything but a specific JSON structure (e.g. plain text) is entered.I tried all formats in the new enum
AudioResponseFormat
and found that only.json
worked fine, text, Verbose JSON, srt and vtt caught any errors.AudioResponseFormat.json
AudioResponseFormat.text
AudioResponseFormat.verboseJson
AudioResponseFormat.srt
AudioResponseFormat.vtt
I have not tried testing with the AudioTranslations API, but it may contain same problems.
Error example 1
Error example 2
Expected behavior
Correctly decode returned data as JSON or plain text (including vtt, srt).
Desktop (please complete the following information):