A Python library for interacting with Google Assistant API via text
Project description
gassist_text
A Python library for interacting with Google Assistant API via text
Credits
Uses https://pypi.org/project/google-assistant-grpc/. See instructions there how to get credentials.json
.
Code is essentially a copy of https://github.com/googlesamples/assistant-sdk-python/blob/master/google-assistant-sdk/googlesamples/assistant/grpc/textinput.py wrapped in a package.
Example
import json
import google.oauth2.credentials
with open('/path/to/credentials.json', 'r') as f:
credentials = google.oauth2.credentials.Credentials(token=None, **json.load(f))
from gassist_text import TextAssistant
with TextAssistant(credentials) as assistant:
print(assistant.assist('tell me a joke')[0])
print(assistant.assist('another one')[0])
How to run
$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -r requirements.txt
# Run command line interactive tool
$ python gassist_text/textinput.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gassist_text-0.0.1.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for gassist_text-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70c64cf441641e809c62a68f6535ccdea3e17dafa4fcc56fee3e86ae27a51598 |
|
MD5 | 62d2d41665bc446af7129ca8cf23540f |
|
BLAKE2b-256 | 96cc97434549db927e72e6783fbc6370fb7485f74c622daad586fdf856069dbd |