openai-python
openai-python copied to clipboard
Transcription function cannot handle response format specifications of "text" or "vtt"
Describe the bug
Transcription function cannot handle response format specifications of "text" or "vtt". When those are specified, an exception is raised.
To Reproduce
- Using Python, obtain a transcript for an audio file:
transcript = openai.Audio.transcribe("whisper-1", audio_file, response_format=response_format)
. - Note that
response_format="json"
andresponse_format="verbose_json"
work without issue. - Replace response format with
response_format="vtt"
orresponse_format="text"
- Note that the code now raises an exception
json.decoder.JSONDecodeError
Code snippets
No response
OS
Linux
Python version
Python 3.10.6
Library version
openai 0.27.0