transcription_api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from bismuth import API

class TranscriptionAPI(API):
    def __init__(self):
        super().__init__(
            title="Advanced Transcription API",
            version="1.0",
            description=""
        )
        # We'll show these as you scroll.
        self.add_route("/store_audio", {
            "POST": self.store_audio
        })
        self.add_route("/transcribe", {
            "POST": self.transcribe
        })
        self.add_route("/get_transcription", {
            "GET": self.get_transcription
        })
        
        self.assembly_api_url = "https://api.assemblyai.com/v2"