#!/usr/bin/env python3
+# © Copyright 2021-2022, Scott Gasch
+
"""A module to serve as a local client library around HTTP calls to
-the Google Assistant via a local gateway."""
+the Google Assistant via a local gateway.
+
+"""
import logging
import warnings
-from typing import NamedTuple, Optional
+from dataclasses import dataclass
+from typing import Optional
import requests
import speech_recognition as sr # type: ignore
)
-class GoogleResponse(NamedTuple):
+@dataclass
+class GoogleResponse:
"""A response wrapper."""
- success: bool
- response: str
- audio_url: str
- audio_transcription: Optional[str] # None if not available.
+ success: bool = False
+ response: str = ''
+ audio_url: str = ''
+ audio_transcription: Optional[str] = None # None if not available.
def __repr__(self):
return f"""