MCPcopy Create free account
hub / github.com/SevaSk/ecoute / APIWhisperTranscriber

Class APIWhisperTranscriber

TranscriberModels.py:27–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 return ''
26
27class APIWhisperTranscriber:
28 def __init__(self, api_key=None):
29 self.client = OpenAI(api_key=api_key)
30
31 def get_transcription(self, wav_file_path):
32 try:
33 with open(wav_file_path, "rb") as audio_file:
34 result = self.client.audio.transcriptions.create(
35 model="whisper-1",
36 file=audio_file
37 )
38 return result.text.strip()
39 except Exception as e:
40 print(e)
41 return ''

Callers 1

get_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected