openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

Transcription function cannot handle response format specifications of "text" or "vtt"

Open matthew-at-qamcom opened this issue 1 year ago • 0 comments

Describe the bug

Transcription function cannot handle response format specifications of "text" or "vtt". When those are specified, an exception is raised.

To Reproduce

  1. Using Python, obtain a transcript for an audio file: transcript = openai.Audio.transcribe("whisper-1", audio_file, response_format=response_format).
  2. Note that response_format="json" and response_format="verbose_json" work without issue.
  3. Replace response format with response_format="vtt" or response_format="text"
  4. 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

matthew-at-qamcom avatar Mar 17 '23 04:03 matthew-at-qamcom