MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / AudioReader

Class AudioReader

KVCOMM/tools/reader/readers.py:136–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134
135
136class AudioReader(Reader):
137 @staticmethod
138 def parse(file_path: Path) -> str:
139 logger.info(f"Transcribing audio file from {file_path}.")
140 client = OpenAI(api_key=OPENAI_API_KEY)
141 try:
142 client = OpenAI()
143 with open(file_path, "rb") as audio_file:
144 transcript = client.audio.translations.create(
145 model="whisper-1",
146 file=audio_file
147 )
148 return transcript.text
149 except Exception as e:
150 logger.info(f"Error transcribing audio file: {e}")
151 return "Error transcribing audio file."
152
153class PPTXReader(Reader):
154 def parse(self, file_path: Path) -> str:

Callers 1

readers.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected