Description:
When trying to convert telugu speech to text using Python SDK for OpenAI, getting following error:
Error code: 400 - {'error': {'message': \"Language 'te' is not supported.\", 'type': 'invalid_request_error', 'param': 'language', 'code': 'unsupported_language'}}
Steps to reproduce:
- Record audio in telugu
- Using python sdk for OpenAI, call
audio.transcriptions.createfunction by passinglanguage="te" - Function call should return following error message:
Language 'te' is not supported
Sample Code:
filepath="telugu_speech.mp3"
client = OpenAI(api_key="API_KEY")
with open(filepath, "rb") as f:
client.audio.transcriptions.create(model="whisper-1",file=f,response_format="text",language="te")
Output:
Error code: 400 - {'error': {'message': \"Language 'te' is not supported.\", 'type': 'invalid_request_error', 'param': 'language', 'code': 'unsupported_language'}}
Reference links:
According to the audio.transcriptions.create function documentation,te is a valid language code for telugu language. Check this:
language: The language of the input audio. Supplying the input language in
[ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will
improve accuracy and latency.