Communicate with the gAssistant in written and spoken form. This is a simplified version of google's gRPC assistant service. This is an instruction for the Python Language. For other languages, please check the link above.
Do the following steps to setup the enviroment:
- Configure a Developer Project and Account Settings.
- Register the Device Model.
- Clone/ Download this repo and cd into it.
- Install local dependencies.
sudo apt-get install portaudio19-dev libffi-dev libssl-dev
pip install -r requirements.txt
If you don't want to mess up your python configurations, I would recommend a virtual enviroment.
In order to run the script, you first have to set up the ./config.py file. The values can be overwritten temporarily by adding arguments when calling the script (see below). Just open the ./config.py and you see which values you will have to change.
As soon as you changed ./config.py, you can start talking with your google assistant!
python writeWithAssistant.py
Show all (optional) options with python writeWithAssistant.py --help
python talkWithAssistant.py
Show all (optional) options with python talkWithAssistant.py --help
If you want to communicate with the google assistant, you always have to specify a device you are talking with. More information regarding that can be found here. If you are a fan of REST calls, check the below out: You will need: A. device_model.json (an example can be found in ./configs). B. authorization accesstoken. In order to get it, do Setup, step 1, but leave out "--save", so you get the token.
Remember to substitute the $PARAMETERS in the URL below.
curl -s -k -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESSTOKEN" -d @$DEVICE_MODEL_ID.json \
https://embeddedassistant.googleapis.com/v1alpha2/projects/$PROJECT_ID/deviceModels/
curl -s -k -X GET -H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESSTOKEN" \
https://embeddedassistant.googleapis.com/v1alpha2/projects/$PROJECT_ID/deviceModels/$DEVICE_MODEL_ID
curl -s -k -X GET -H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESSTOKEN" \
https://embeddedassistant.googleapis.com/v1alpha2/projects/$PROJECT_ID/deviceModels/