I have a AIY Voice Kit fully assembled and functional (I have tested the 3 demos.py sucessfully). I managed to launch the demo where we have to push the button to launch the Google assistant. But now I wan that it ONLY trigger my Google action (and directly launch « Welcome to XXXX app. Do you want… »). How can I manage to do that ?
Asked
Active
Viewed 938 times
0
-
Can you provide some of the code you're using, or a link or two? – Zev Averbach Dec 10 '18 at 17:03
-
https://github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/examples/voice/assistant_grpc_demo.py – Fab_ Dec 11 '18 at 16:47
2 Answers
1
You can override your button handler and pass in a text string by default, kinda like is done in the text input sample.
def buttonPress():
assistant.assist(text_query="talk to XXXX app")

Nick Felker
- 11,536
- 1
- 21
- 35
-
I tried to add this to https://github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/examples/voice/assistant_grpc_demo.py but unsuccessfully. Do I have to add this to main function ? – Fab_ Dec 11 '18 at 16:48
-
It looks like that script is using an old version of the gRPC library. You may want to try using the linked sample instead, as it uses version 0.5 instead of 0.2. – Nick Felker Dec 11 '18 at 18:44
-
I'm lost... I have installed a new google assistant sdk according to https://developers.google.com/assistant/sdk/guides/service/python/embed/install-sample. I have copied and modified your file 'textinput.py' : https://github.com/googlesamples/assistant-sdk-python/blob/master/google-assistant-sdk/googlesamples/assistant/grpc/textinput.py#L185 but I have an error "ImportError: No module named google.auth.transport.grpc" – Fab_ Jan 04 '19 at 11:37
-
You need to copy the entire repo and install dependencies in requirements.txt – Nick Felker Jan 04 '19 at 15:51
-
I have copied the entire repo and install dependencies in requirements.txt. Now when I launch the original pushtotalk.py it works but nothing happen when I launch textinput.py, neither with the original one or with the modified one (console : 'INFO:root:Connecting to embeddedassistant.googleapis.com : ') – Fab_ Jan 11 '19 at 14:37
-
I'm not sure where I have to insert your script and in wich python file ? It works on textinput.py but output is only in text and stop after first sentence of the GA app. – Fab_ Jan 15 '19 at 16:30
0
You can create regular HTTP links that triggers your action if you are on a device that has assistant. See the official documentation: https://developers.google.com/actions/deploy/action-links
You can generate a URL that will link directly to the specific Action, on a per-Action basis. Users who click the Action link in a web or mobile browser will be directed to the Assistant on their device, where they'll interact directly with your corresponding Action.
You'll find it under the AoG console Actions -> <action to trigger> -> Links

Dennis Alund
- 2,916
- 1
- 13
- 34
-
I have already see that but can I add this to https://github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/examples/voice/assistant_grpc_demo.py ? With urlib2 ? – Fab_ Dec 11 '18 at 16:50
-
I don't know the specifics of your device capabilities. It would be best for you to test it out to confirm. But this is the way to directly trigger an action from anywhere. – Dennis Alund Dec 12 '18 at 01:04
-
My problem is to make a python script to launch my action trigger (for example https://assistant.google.com/services/invoke/uid/000000d139bbc4d4) automatically. (I found that I have to make a .service on the raspberry pi to automatically launch a script after booting it.) – Fab_ Dec 12 '18 at 18:19