How to make the agent say something before leaving the mic open? - actions-on-google

Google rejected my app and give the following feedback:
During testing we noticed that when the Action is not able to get data
it opens the mic and leaves it open without prompting. Make sure that
your agent always says something before leaving the mic open for the
user, so that the user knows what they can say. This is particularly
important when your agent is first triggered.
I've built my app using API AI tool and webhooks (connects to a web service running on Heroku). Heroku sleeps after 30 minutes of inactivity. I think this error occurs when Heroku takes a long time to respond. Any idea how can I make the agent say something before leaving the mic open?
I am not sure why I got this feedback because in case the web service request times out, Google Home speaks the following response.

It might answer the text response you added on API.ai but at the bottom of the page of your intent (under the text response) click on "Actions on Google" then check "End conversation" Check this screenshot

When you use assistant.ask in your fulfillment logic, you should be asking the user a question. It should be clear to the user what they are expected to answer.
If your fulfillment instance goes to sleep or doesn't respond quickly, then typically the assistant will play a message that indicates your action isn't responding.

Related

Google Actions rejected in review due to "Mic is open" issue

I'm having trouble submitting my Google Actions skill (this skill is Dialogflow based).
This is the message after submitting my skill.
Your Action leaves the mic open for a user command without a prompt, such as a greeting or an implicit or explicit question.
Note: Thank you for submitting your Assistant Action for review.
However, your Action has been rejected for the following:
1. Your Action violates our User Experience policy. Specifically, your Action listens for a user command by leaving the mic open without a prompt such as a greeting or an implicit or explicit question.
After the Action responds to "メニュー画面”, the mic remains open without a prompt back to the user.
For example,
User:メニュー画面
Action: *Mic is open* At this point, either prompt the user with further options or close the Action.
After reading the feedback, I understand that the phrase メニュー画面 causes the microphone issue.
I've tried to enter this phrase メニュー画面 in my Google Assistant application on iOS and my phone just opens the Setting menu without giving a defined response as I configured in Dialogflow intent.
I've tried to enter this phrase on Google actions web console in Phone mode and nothing happen and the request is empty
Empty response on Google actions
My expectation after entering this phrase: Google actions won't detect any intent that matches this phrase and the DefaultFallback intent will be triggered and Google will reply with some defined responses.
What can I do to resolve this issue? Thank you.
A cursory translation of "メニュー画面" seems to be "Menu screen".
When you're using Dialogflow, the "Default Fallback Intent" will catch any user utterance that does not match another intent. You should make sure this fallback tries to rescue the conversation by reprompting them or ending the conversation.
This means that in practice asking them a question or closing it.
Because once the Action is given this prompt, the surface will open the microphone and listen for the next user utterance. However, if the response is not a question, the user may not know to say something.
Reprompting the user can be a matter of good design or just as simple as adding something like "What do you want to do?" at the end of each response.
Alternatively, you can just mark the conversation as over. This will not reopen the microphone after its response.

What could be the reason for a Google Action with external endpoint (API) to work on the Actions Console Simulator, but not as deployed?

I am new to the whole creation-process of Google Actions.
I created an Action with the new Action Console.
It has an fulfillment endpoint to my server (as example: www.mypage.com/api).
For testing purposes it has no authentification, so it generates a public API response.
Said API generates a simple JSON response based on a send event handler.
In short: Action onEnter sends handler to API, API queries SQL database and sends the response back to my Google Action that then "speaks" the SQL result.
The result with the Actions Console Simulator is:
Testing with "Smart Display device: everything works.
Testing with "Speaker (e.g. Google Home): everything works.
Testing with "Phone": main intent is invoked and text is shown but does not get spoken.
So i tested the command "Hey Google, talk to the unicorn app" directly on my smartphone.
Here **everything works fine ** as said smartphone has the same e-mail like the one on my Action Console account: it recognizes the main invocation command and when i ask by voice to get the data, the data is received from my server and spoken.
So something is wrong with the "Phone" device in the simulator. This has been confirmed by me from other users saying that they often have trouble with the simulator function correctly.
I then deployed my Action.
It was reviewed and approved.
A few seconds later i received an auto-email saying that there were too many errors with my app, asking me to check its health status. I did so and in the Health tab, i can see that it has an error but it does not show me what the error is.
THEN I CONTACTED A ACTIONS-ON-GOOGLE EXPERT
They helped me a lot into the right direction but could not go deeper into the problem as my connection (the endpoint API) is outside of their servers.
So i ended with their tip on checking the Google Cloud Logging Console.
As said Logging Console is also new for me, i learned on how to query my results but:
How can i query for the so called "is_health_check" flag?
I am asking this because the Google Expert recommended me to search for said flag but i do not know on how to query it.
Sorry for this ultra-long entry but i am trying to be as transparent to you as possible, as i have been trying this out for several days now.
Thanks in advance for your time, ppl!
So the error is simple once that you know how Google handles the external webhooks. Thanks to the help of 2 Actions-On-Google Experts i was informed that Google pings your external Webhook from time to time.
As soon as they get an error as result from said ping, the Action will be deactivated from the Assistant until a new ping response sends that everything is fine again.
My problem was that after deploying the action and while it was under reviews, i continued to work on the code on my server. While coding, the Google server pinged and received an error code.
My fault, but at least i learned the thing about pinging your action!

DialogFlow google Home Assistant keeps listening, does not pause

I have created a chat bot which responds to request.This is the flow currently happening:
I say "Talk to My Test App"
My app starts and says welcome message.
I request something and my intent is fulfilled
After this the Google Home does not pause but keeps on listening.
If I stop it then again I will have to say "Talk to My Test App", which I also don't want.
I want google home to sleep after fulfilment.
and Awake in the same app when I say "Ok Google"
More details:-
In my use case the user will talk to the app frequently, for example after every 30 seconds-2mins. I don't want him to say every time "Hey Google" to wake up and then "Talk to My App" and then the command. I also don't want to say long sentence after waking up the Google Home like "Talk to My App to Do this".So I thought it would be better that my app doesn't stop by ending the conversation, instead it should be paused.So that the user can just wake up Google Home and directly pass the command.
Currently Google Home does not pause after the first command and keeps on listening surrounding sounds and responds to the noise, because of this issue user has to stop it.
I needed to have a pause so I can narrate my thoughts but not exit my conversation for a client demo, so I added this in DialogFlow's text response, with a very long break at the end of each text response. I can then interrupt the pause with "Okay Google" and stay within my conversion.
<speak>This is a sentence with a <break time="600s"/> pause</speak>
As the name suggests, a conversational VUI suggests that you're going to have a conversation with the agent. Not something with long pauses in between. The assumption is that if there is no reply, that the user isn't actively engaging in the conversation. There is no direct feature that does what you want, although there are a couple of interesting workarounds that might work for you.
First, as you suggest, deep linking with a phrase such as "Hey Google, ask My App to Do This" is certainly a possible approach, and one that you should support. In production, and as a user uses it more, the introduction and hand-off from Google gets shorter and shorter. Even the launch phrase can be shortened with the user creating a Shortcut - but this is a choice of the user, not you.
Although there is no way to "pause" a conversation, there is a way to have the reply include streaming audio that the user can interrupt. Using a Media Response begins playing that media.
When the URL pointed to by the media ends, your Action gets a callback (via an Event in Dialogflow or an Intent with actions.json) indicating the media has ended, and you can do something like play another Media Response, and continue to do this as long as appropriate.
Are any time, your user can interrupt the audio by saying "Hey Google" and some command. This will trigger any matching Intent, as if they said a command as usual.
There are some caveats with this scheme - some commands don't actually work (anything with "next" in it, for example, since that sounds more like a media command that isn't implemented), and you need an audio of reasonable length that won't be distracting in your environment, but this might be a reasonable solution to your scenario.
If you want to exit the conversation you may do the following:
Go to the dialogflow console.
Create and intent (say goodbye).
In the Event section, enter 'actions_intent_CANCEL' in the add event field.
Enter your Training Phrases. (Say exit, stop, pause etc)
Enter your greetings (say goodbye) in text response. You may skip this if you don't want to reply.
Enable 'Set this intent as end of conversation'.
Save

Open Mic issue for DialogFlow app

My submission of Dialogflow app got denied due to open mic issue.
ERROR : "During our testing, we found that your app would sometimes leave the mic open for the user without any prompt. Make sure that your app always says something before leaving the mic open for the user, so that the user knows what they can say. This is particularly important when your app is first triggered.
Current implementation :
User asks something and app replies back with static text and a static basic card content. The Google Assistant bot reads out the text and then mic open momentarily for user voice input.
NOTE THAT :
THERE IS NO FULFILLMENT REQUEST.
I DO NOT WANT TO END CONVERSATION HERE
ALL ARE STATIC RESPONSES
HOW DO I SOLVE THIS ?
The important part in the rejection is that you left the mic open without any prompt.
This usually means that your action has said something like "The answer is four" without giving any idea what the user should do now, or that it is the user's turn to speak.
A reply such as "The answer is four. What would you like to do now?" should meet the requirements. The point is to prompt the user to be aware the conversation isn't over.

How do you allow the user to cancel while the Google Assistant is responding via a webhook?

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:
Welcome intent: User is asked for two parameters
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?
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
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).
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.