#!/usr/bin/env python3
import logging
-from typing import NamedTuple
import sys
import warnings
+from typing import NamedTuple, Optional
import requests
import speech_recognition as sr # type: ignore
success: bool
response: str
audio_url: str
- audio_transcription: str
+ audio_transcription: Optional[str] # None if not available.
def __repr__(self):
return f"""
success = False
response = ""
audio = ""
- audio_transcription = ""
+ audio_transcription: Optional[str] = ""
if r.status_code == 200:
j = r.json()
success = bool(j["success"])