Linking from my Actions on Google to a web url - dialogflow-es

I have a Dialogflow fulfillment integrated with Google Assistant. Right now whenever using voice with Google Assistant, every time the assistant finishes responding, it tries to catch a user response. This is problematic, because I have a simple response with a rich response that is a BasicCard with a url button link. If the user clicks on the link before the assistant finishes reading out the text response, then the user would be taken back to the Action after clicking on the link when the assistant finishes responding, which is a bad experience. Is there a solution for this?
It seems like the reason it goes back is because the assistant wants to prompt the user for a response. Is it possible to stop the Action from whatever it's doing once the user clicks on the link? Or would it be possible to not prompt the user for a response after the assistant responds?
I'm using node.js and I have tried both conv.ask and conv.add, but they both automatically catch audio from the user right away after the voice response finishes from the Action.
I am using an iOS device for testing.

Related

Dialogflow Show welcome text without user action

I am trying to show welcome text when user initiates the chat i.e. without any action from user. How to achieve this?
I tried NPM dialog flow or #google-cloud/dialogflow to detect intent to trigger the intent using node.js. It is sending the query and showing the fullfillment text in console but not on updating the UI like when user interact with bot.
Thanks.
If you're using Actions on Google, then your welcome Intent will be called when your Action is first invoked. The user wouldn't say anything besides "talk to action name".
Using the Actions on Google test emulator, this is provided as a button.
If you're using the Dialogflow tester on the right side of Dialogflow, you need to enter one of the invocation phrases for the Welcome Intent, but these phrases aren't typically used as part of the Action itself.

Error: Cannot display response in Dialogflow simulator. Please test on the Google Assistant simulator instead

I am using dialog flow to create an agent. When I try to embed it in my website, it gives me following error, "Cannot display response in Dialogflow simulator. Please test on the Google Assistant simulator instead.". It works perfectly fine in Google Assistant Simulator. I have seen people embed in their websites, but I don't know what I did different.
Any help would be appreciated.Code1 Code2 Code3 Code4
The expected output is a conversation between user and agent.Screenshot of my web page Screenshot of Dialog Flow Console
Okay, judging by the screenshots you added, you are trying to send a Google Assistant specific response to Dialogflow. In your welcome intent you are returning an Permissions object. This is something that only works for the Google Assistant. The web demo that you are trying to embed into your website doesn't support Google Assistant specific objects.
If you want to use the webdemo try sending only texts messages back to your user by using conv.ask("Your response") and conv.close("Your response") or give a response specific for Dialogflow. You can do this by either checking the request in code and sending a different text only response for Dialogflow users or you can create a Dialogflow only response in the Dialogflow console. Dialogflow responses are refered to as Default on the console.

Facebook Graph API - Postback Event Issue

There is a problem when the user is clicking a postback button and the internet connection is not stable or is reconnecting from the internet. After reconnecting to the internet, it will look like the user has successfully clicked the button (Labeled as Sent) but my webhook is not getting any postback events. So the user does not get any response from my bot unless they click the button again with a stable connection.
I already sent a support ticket to Facebook regarding this. I'm asking help for a workaround this issue, that will continue the conversation or maybe a reminder that the user must click the button again to progress.
I'm using Node.js and Microsoft Bot Framework for this.
While I am unfamiliar with Facebook Messenger for bots, as far as I can tell, a postback button seems to work the same as any other button, with added async functionality. The intermittent internet connection appears to be interrupting that async call. There isn't a work around that I know of, as your bot is still waiting for a response from your user, a response that won't come, if your user thinks they've already sent info to the bot.
I would put a proactive/welcome message in the very beginning of your bot dialog that if the user is connecting with a weak/intermittent internet connection, to resend their response if the bot doesn't respond. If you're using the bot for sales purposes, then a message to not use the bot unless they're using a stable internet connection as they could accidentally send a purchase order twice, would be more appropriate.

Google Home send GET request and say response

There is an API available online that responds with a number (number of points) when you submit a GET request to a certain URL.
I'd like my Google Home to say this information when I ask it to. I have attempted to do this with DialogFlow but I'm not sure how I would go about doing it.
EDIT: I used the DialogFlow fulfillment webhook feature. DialogFlow sends a post request to my webserver and the server responds with "fulfillmentText" which is what the Google Home will say.
There is nothing built-into Google Home that will get information out of the page at a URL.
You can write a program that will be triggered by the Assistant using Actions on Google. This includes something that would run through Dialogflow, or it could run through the Actions SDK. Either way - you would do this by writing a program that would be called in a webhook to fetch the data and return a message that would be read by the Assistant on your Home.

Return response to Google Assistant via API

I have a Actions on Google project that uses api.ai for its actions. This is working well and I can see request/responses appear on the google assistant interface (On mobiles and simulator)
One of my usecases for api.ai needs to broken into 2 parts, in that we have to inform the user that the processing has started and then inform them again once its completed (without them reprompting for the output).
Im trying for a way to inform the user who is using the Google assistant when the processing is completed, but have failed so far. Something like this
User: I would like to see if my loan request is approved
Google Assistant: Hold on, let me check and let u know .
.... (Makes a webservice call to the backend asynchronously)
.... After few seconds ...
.... Postback to google assistant from the webservice
Google Assistant: Thanks for holding, your request is approved.
Im not sure how to do the "postback to google assistant" call. I have tried to get the SessionId from the Api.AI call and then use that to make a event request , but that doesnt seem to send the response to the assistant. Google Assistant seems to be using the formats defined in https://developers.google.com/actions/reference/rest/Shared.Types/AppRequest, but Im unsure how to get the ConversationToken and use that for sending the response back to the user.
Short answer: you can't do that.
Slightly longer answer: At least right now, there is no good way to send a notification. Your Action can only respond to a specific statement from the user. You can say something like "ask again in a minute and I should have a result for you", but that isn't a great experience. At Google I/O 2017, they announced that notifications would be coming to the Google Home at some point... but gave neither a time frame nor any information about an API.
Long, but probably still unsatisfying answer: You can look into Transactions which let them initiate purchase or request of some sort and then "check out". Once they have checked out, you would confirm that a transaction is being processed with an OrderUpdates and then can send updates with the status of the "order". These status updates can turn into notifications or user's can query the state of the order at any time. Transactions don't require payment, so this may work depending on your needs.
However, there are a few things to note. This is still in developer preview, so things may change in the future. It also doesn't work on all surfaces where the Assistant runs, so while it does work on Assistant on phones, it does not work on the Google Home right now.

Resources