Search code examples
dialogflow-esactions-on-googleapi-aigoogle-assist-api

Api.ai - How to start the Google Assistant (Actions on Google) with a command other than "Talk to [application name]"


I'm working with Api.ai to make an app on the Google assistant. Everything is working as expected except that I cannot get the assistant to recognize my application with any key words except for "Talk to [app name]".

At first, I didn't think that it was possible at all, but I saw the Google I/O presentation of it. It looked like this:

enter image description here

So it looks like they are starting the Panera app with "I'd like delivery from Panera". So I don't know if the demo was fake or not, but they didn't have to start it with Talk to Panera.

I did some research and saw that this option isn't necessarily in Api.ai, but it might be in the "Actions on Google".

I'm setting these options you see below, but it still doesn't work.

enter image description here


Is this a bug with Api.ai or "Actions on Google" or am I doing something wrong?

When I try "Order with [my app name]" I get this error.

"Sorry, this action is not available in simulation"

And if I try "Talk to [my app name]" on my pixel phone, the test app opens, but if I say "Order from [my app name]" on my pixel, it just finds search results. So I've come to the conclusion that it just doesn't work.


Solution

  • This is kinda tricky and complicated. Chances are good you're not doing anything "wrong", but at the same time the Panera demo wasn't exactly "fake" either.

    Action Discovery is actually very similar to websites and SEO. There are a number of specifically documented trigger phrases in addition to "talk to" which can be used with the invocation name of your action. In addition to these documented ones, that page also suggests that there can be other phrases that also work the same way - for example, "ask" works as well as no trigger phrase and just using your invocation name. You can think of these explicit invocations as being similar to a user entering in a specific web URL.

    Additionally, you can also register other suggested phrases. Google may use these phrases, as well as others it may set, to suggest your Action to users if they use the phrase. If the phrase is associated with your Action enough, it may just trigger your action directly. This is like using a search engine on your Action and having Google return a snippet in the search results. There may be other cues that could influence this as well and, like other SEO influencers, Google doesn't necessarily publish what those indicators are. (So we might assume that using the Action Transaction API could allow other phrases, but thats just an assumption on our part.) This sort of thing has been mentioned publicly a few times by Googlers, but you can see more about this at their I/O presentation on Discovery (https://youtu.be/By972_gh9DY?t=7m50s) and a presentation by Brad Abrams (https://youtu.be/koWTxk-qfJE?t=17m36s)

    Exactly which one applies to Panera is difficult to tell. It could be that they have registered the invocation name of "delivery from Panera" and thus "I'd like" is a suitable trigger phrase. Or it could be that they've nudged things so the whole phrase triggers an Action named "Panera" because it uses Transactions.