auth_token = "replace this with your auth token"
txn_id = "Replace this with your transaction ID"
#Note: the speech to text model does not depends on any other models, hence
#can be used independently
def get_speech_to_text():
url = "https://api.marsview.ai/cb/v1/conversation/compute"
"modelType":"speech_to_text",
"automatic_punctuation" : True,
"custom_vocabulary":["Marsview", "Communication"],
headers = {'authorization': '{}'.format(auth_token)}
response = requests.request("POST", headers=headers, json=payload)
if response.status_code == 200 and response.json()["status"] == "true":
return response.json()["data"]["enableModels"]["state"]["status"]
raise Exception("Custom exception")
if __name__ == "__main__":