Page 1 of 1

Action Google Assistant

Posted: 27 Oct 2017 07:35
by Wibbly
Is there a way to reliably feed input to Google Assistant?

I would like to consider a flow that triggered Google Assistant to read me news headlines, tell me the weather, etc

Re: Action Google Assistant

Posted: 27 Oct 2017 08:52
by Desmanto
I am not sure what you mean. Google Assistant should be receiving the input via voice or keyboard and process it. If you wanna do what the assistant do, why not just create the flow to read the headlines and weather?

Or maybe you mean to start the google assistant in the flow? If that so, Google assistant is just a shortcut inside Google App. Just use Action Launch App, Package name choose google (com.google.android.googlequicksearchbox), for class name, choose Google Assistant (com.google.android.apps.gsa.staticplugins.opa.hq.OpaHqActivity), or simply search "opahq", select the first one.

Re: Action Google Assistant

Posted: 27 Oct 2017 11:12
by Wibbly
Desmanto wrote: Or maybe you mean to start the google assistant in the flow? If that so, Google assistant is just a shortcut inside Google App. Just use Action Launch App, Package name choose google (com.google.android.googlequicksearchbox), for class name, choose Google Assistant (com.google.android.apps.gsa.staticplugins.opa.hq.OpaHqActivity), or simply search "opahq", select the first one.
Thanks

Yes, that's what I want to do. Can I pass the query text to Google Assistant at the same time and get it to respond other than, perhaps, driving the UI which always seems a bit cluncky and may not work with the phone locked?

Re: Action Google Assistant

Posted: 27 Oct 2017 15:29
by Desmanto
I probably can guess what you want. Creating a flow to check news and weather is not a problem for you. But maybe you think since you are going to use assistant anyway, why don't just let the assistant do the whole job, rather than developing our own solution again. We can use the time to create another flow which asisstant can't do.

If that so, I also haven't found a direct method to start the activity and send the query text immediately. There are two choices, depend on which distraction you can live with. The first one using the Control UI, where after starting the assistant, you will set the search field to the desired command. This required the search setting default to keyboard.

The second is to use speech output. You have to use a better TTS engine which can sound more natural, such as Vocalizer, locuendo, acapela, ivona etc. Open the shortcut to google assistant and the next action is Speech output to speak out the command you want. Basically, you are having the phone "speaks" to google assistant (it is voice commanding itself = voice command-ception :D ). You have to turn the speaker volume to certain level that can be picked up by your microphone. Since you are using Google Assistant, I think you don't mind the voice distraction.