How To Change "Action and parameters", later on in your Google Action? - dialogflow-es

So I was using Gmail Google Action on my Assistant device and One thing that I found particularly intriguing was that when a user has given its message and email, after that assistant gives options for change or adding the message. That means on selecting those options, assistant will change the value of message entity or edit it as per user command, without re-enabling the whole intent.
My question is how can I implement this functionality in my Google Action. Is there any particular function made by Google that I can use or do I have to create one from scratch ?

Gmail's integration is a bit different than the way a third-party developer would do it, but you can save user input from the current session and modify it later on in your conversation. In your Action, this wouldn't be just one intent, but a few that would handle the work of modifying some session data and finally using that data to complete the user's original action.

Related

How do you make sure you're getting the correct user's email in Dialogflow when they are speaking it?

Hi I'm not a coder and need guidance.
I'm creating a simple skill for Google Assistant in Dialogflow where the goal is to get a user's email. However, when I test it out verbally in Google actions console most of the time it picks up the wrong email address, (I'll say nhs.com and it thinks I'm saying something different) even though I have put example emails in the entities bit.
What is the solution around this? Is it possible to ask permission in Dialogflow to get a users data? I think Google Assistant says no you can only do that (account linking) if you build in Google Assistant? Can you ask the user to verbally spell out their email address, although no idea how you would go about doing that.
It is not recommended to ask the user for their email. Emails can have a very difficult structure consisting of characters and numbers. Because of this Google provides you with the option to retrieve the users details via accountlinking. I've listed some options for retrieving an email.
1) Google Sign-in (Requires Code)
Since you said you aren't a coder it will be a bit challenging to get the user's email easily. Your best option would be to use Google Sign-in accountlinking. This provides your bot with a flow that asks the user permission to use their email automatically.
To be able to use this code, you might have to use some code since I do not know if Dialogflow supports retrieving the user email from the webpage when using accountlinking.
The benefit of Google Sign-in is that you will get the active email that is in their Google profile.
2) Regex entity (Requires some technical knowledge about regex)
Dialogflow supports a feature called Regex Entities. With these entities you can provide a regex which will look through the user input for a pattern. If the user input matched the pattern it will take this from the user input. In your case you would need a regex to check for an email pattern.
With a regex entity the user can be prompted to tell their email. With this you approach you won't be certain if it actually is their real email and you might have to add a flow to double check if there weren't any typos in the email.
3) Email entity (Least technical option)
As Rally mentioned in the comments, Dialogflow also supports an email entity. This can be used to automatically detect an email in your user's input. Though it is an easy option to use, I've noticed that it doesn't always detect every email and since you can't improve it's behavior, it might not be the best choice. It definitely is the least technical option, but it might not always work.

The words "not working" always trigger the default intent in Google Assistant

I have been working with Google Dialogflow to create a Google Assistant experience.
My GA Action is to Raise Support tickets and those tickets are raised in our system via API.
We ask the user to describe the Issue they are facing, We have used a fallback Intent to capture the Issue/Ticket Description(Since the reply can be any free text, is this the best way to capture free text?).
Once the user gives a description, A webhook is called and the results are sent to our backend to capture.
We have noticed that when the user uses the words "not working" as a part of the issue description, it always calls the welcome intent, instead of going to the follow up Intent. If the user describes the Issue without using those words, it works fine. Below are 2 different responses.
I personally feel that this is a bug in GA, is there any way to solve it?
I think you're doing some things wrong. I don't have enough information to understand 100% what you are doing, but I will try to give you some general advice:
A fallback intent is used to 'fall back' to this intent when a user asks something that is nowhere provided in one of your other intents. That's why your fallback intent has the 'input.unknown' set as action. It will be triggered when the user gives some input that is unknown for your application. F.e. I don't think your '(Pazo) Support Action' will provide an answer if the user asks to book a plane to Iceland, so that's when your fallback intent comes in to give an answer such as 'Sorry, I can't answer that question. Pazo is here to give you support in... What can I do for you?'
Your user can either register a complaint or raise a support ticket if I'm getting this right? I recommend you to make two seperate intents. One to handle the complaints and one to handle the support tickets.
Before developing advanced actions with a seperate webhook and a lot of logic with calling an API etc., I recommend to go through the documentation of Actions on Google:
https://developers.google.com/actions/extending-the-assistant

How to ensure my Google Home Assistant application is not rejected?

During our testing, we were unable to complete at least one of the behaviors or actions advertised by your app. Please make sure that a user can complete all core conversational flows listed in your registration information or recommended by your app.
Thank you for submitting your assistant app for review!
During testing, your app was unable to complete a function detailed in the app’s description. The reviewer interacted with the app by saying: “how many iphones were sold in the UK?” and app replied “I didn't get that. Can you try with other question?" and left conversation.
How can I resolve the above point to approve my Google Assistant action skills?
Without seeing the code in question or the intent you think should be handling this in Dialogflow, it is pretty difficult - but we can generalize.
It sounds like you have two issues:
Your fallback intent that generated the "I didn't get that" message is closing the conversation. This means that either the "close conversation" checkbox is checked in Dialogflow, you're using the app.tell() method when you should be using app.ask() instead, or the JSON you're sending back has close conversation set to true.
You don't have an intent to handle the question about how many iPhones were sold in the UK. This could be because you just don't list anything like that as a sample phrase, or the two parameters (the one for object type and the one for location) aren't using entity types that would match.
It means that somewhere, either in your app description or in a Dialogflow intent(they have full access to see what's in your intents) you hinted that “how many iphones were sold in the UK?” would be a valid question. Try changing the description/intents to properly match the restrictions of your app.

Server-side query using events or/and context?

I’m coding a bot using PHP-BotMan for complexity reasons and using Dialogflow query api to extract and manipulate the informations from the response. I saw examples and hints from people here and on dialogflow forum suggesting using context or events, some of them mixing both. What is the better way to handle this?
The flow of the application is:
user messages bot
bot queries (text or/and #event?) dialogflow
internally process a reply or return dialogflow slotfilling* request
text response bot reply user with last reply or asking to fill slot
Also, how can I be sure that a slotfilling process is finished with “actionIncomplete” only having two values, NULL or TRUE? The dialogflow query response doesn’t show wich slotfilling parameters are required or not…
Thanks for the help!!
slotfilling is when dialogflow sends a text response requesting required parameters to finish an intent, adding those replied values to the context
I was trying something similar to your scenario, here are few points i found helpful:
When Slotfitting with webhook, i can't use the "Required" params field since i have to control the input parameters via webhook (query database to provide options). Which means actionIncomplete field is not useful anymore.
I personally prefer to use context as it can add/remove params which gives you more control.
Hence the dialog was designed to use webhook to check all required params before move on to next conversation flow. and pop quick replies menu to ease and restrict possible input from users.
HTH.

Custom Links with Messenger Bot via Microsoft Botframework

Clicking https://www.messenger.com/t/xxxxxxxx will take you to a bot and continue the conversation, if there was no conversation it'll begin it's 'firstRun' sequence.
Is it possible to create links that will execute a specific dialog and pass in data? It should ignore previous dialog state/stack and start a new stack with the specified data as argument to that dialog.
This is not possible. The url is used to identify the user/bot in messenger. The bot doesn't see the url so it can't read from it.
I would suggest taking a different approach. You could let the user pass in the code instead of adding it to the url.
There is a new functionality in Messenger platform that allows you to send specific messages to a bot: https://developers.facebook.com/docs/messenger-platform/referral-params
I haven't tested it yet, but it may help you.

Resources