2

I have a Google Action (using API.AI) that is very similar to the Silly Name Maker webhook example.

However, my app was rejected for the following reason:

One or more of your actions does not allow a user to easily exit a conversation. Please make sure that you do not continue to converse with a user if they ask to cancel or exit.

When you say stop, cancel or quit when the mic is open, it responds "Sure, canceled", closes the mic and exits. However, when you try using those commands while the agent is speaking, it does close the mic and exit but it doesn't say "Sure, canceled" as it's supposed to.

My Action is set up like this:

  1. Welcome intent: User is asked for two parameters
  2. Webhook response: Once all the parameters have been supplied, a webhook (structured exactly like this Silly Name Maker webhook) delivers a single sentence and then immediately ends the conversation.

During the Welcome intent, if a user says "Okay Google, cancel" while the agent is speaking, it responds "Sure, canceled" and exits.

However, while the agent is speaking the webhook response (from assistant.tell()), if you say "Okay Google, cancel" it will exit immediately without saying "Sure, canceled."

How do I get the Google Assistant to say "Sure, canceled"? Do I have to set up a "cancel" intent in API.AI, and use an actionMap on my webhook to handle a user's request?

Dan Leveille
  • 3,001
  • 2
  • 24
  • 28

3 Answers3

0

Use assistant.ask(), not tell, then cancel should work. You can have a look at https://github.com/actions-on-google/actions-on-google-nodejs/blob/master/assistant.js

  • But isn't the point of asssitant.tell() to speak a final response and then cancel? Seems strange to get rejected with what seems like intended behavior -- especially if it's whats in their demo action. (I recently followed up with Google explaining my specific behavior to see if there was some sort of mistake by the reviewer -- waiting to hear back.) – Dan Leveille Feb 07 '17 at 20:49
  • It is indeed strange review feedback. I'm betting they let you through, but I have an answer below nonetheless, which would have allowed you to achieve the strange request... – spechter May 15 '18 at 16:13
0

I know this is an old question, but I have an answer nonetheless.

You can trap "Cancel" type requests from the user, if necessary, to play your own 'goodbye' message, as your yellow highlighted request seemed to desire. (Is that review feedback? Weird...)

As described here: https://developers.google.com/actions/assistant/app-exits

The basic trick is to setup an Intent in Dialogflow that is configured for the 'event' of "actions_intent_CANCEL".

Set it to 'end the conversation' (or it won't work, I think).

Don't set any example phrases.

Set the desired 'Response', or set it to hit your webhook.

With that setup, you can get "Cancel" requests to say anything you want on app exit, up to a 60-character limit (To allow the user to quit quickly).

spechter
  • 2,058
  • 1
  • 17
  • 23
0

Currently, there is no way to open up the mic when you are doing an app.tell() from inside your custom app. So, there's no way to interrupt the response.

Only the phrase "ok google" opens up the mic. So you could add user says for "ok Google" to go to your fulfillment. That way you can handle the interruption in your own app.

A.C.
  • 91
  • 4