I'm having the same issue. I can't figure out how to correctly pass the optional parameters to the openai.Audio.transcribe function.
transcript = openai.Audio.transcribe("whisper-1", audio_file, params={"language": "ro"})
I logged the data object that is created inside the transcribe function. The first comment shows the actual result, which is ignored. I hardcoded the data object to make it use the second object, which applies the language correctly. I assume that the same would work for prompts, but I haven't tried that.
For this, I followed the transcribe function, there I followed the cls._prepare_request function and adjusted it. This is the resulting _prepare_request in openai > api_resources > audio.py, lines 15-43:
@classmethod
def _prepare_request(
cls,
file,
filename,
model,
api_key=None,
api_base=None,
api_type=None,
api_version=None,
organization=None,
**params,
):
requestor = api_requestor.APIRequestor(
api_key,
api_base=api_base or openai.api_base,
api_type=api_type,
api_version=api_version,
organization=organization,
)
files: List[Any] = []
data = {
"model": model,
"language": "ro",
**params,
}
print(f"data: {data}")
files.append(("file", (filename, file, "application/octet-stream")))
return requestor, files, data