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

Method parse

KVCOMM/tools/reader/readers.py:138–151  ·  view source on GitHub ↗
(file_path: Path)

Source from the content-addressed store, hash-verified

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

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected