projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup
[python_utils.git]
/
google_assistant.py
diff --git
a/google_assistant.py
b/google_assistant.py
index 4a3a58f5947ab335e26ac2fa1c7ce22afd841a93..adfdca49afb99bc3862611649ad5661ab558249c 100644
(file)
--- a/
google_assistant.py
+++ b/
google_assistant.py
@@
-5,7
+5,8
@@
the Google Assistant via a local gateway."""
import logging
import warnings
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
import requests
import speech_recognition as sr # type: ignore
@@
-34,13
+35,14
@@
parser.add_argument(
)
)
-class GoogleResponse(NamedTuple):
+@dataclass
+class GoogleResponse:
"""A response wrapper."""
"""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"""
def __repr__(self):
return f"""