(file_path)
| 124 | |
| 125 | # Transcribe audio and video files |
| 126 | def transcribe_audio_video(file_path): |
| 127 | transcriber = aai.Transcriber() |
| 128 | transcript = transcriber.transcribe(file_path) |
| 129 | transcript_path = file_path + ".txt" |
| 130 | with open(transcript_path, "w") as f: |
| 131 | f.write(transcript.text) |
| 132 | return transcript_path |
| 133 | |
| 134 | # Upload files and cache them |
| 135 | def upload_files(types=["pdf", "txt", "mp3", "mp4", 'mpeg', 'doc', 'docx'], **kwargs): |