How to connect an back to intent in DialogFlow when the user's utterance is not recognized? - bots

I'm making a bot in Dialog Flow and I have some intents linked together. However, once I end up saying a phrase that's not part of the user says, the bot exits the whole chain of intents and disregards related contexts i try to input next.
Is there a way for me to avoid this situation?

seems like i just needed to use fallback intents, as documented here

Related

How to ask "Was this helpful?" in DialogFlow at the end of conversation after rendering the response from Intent

So I have a flow prepared.
User: I would like to book an appointment
Bot: Sure. Does 3pm works for you?
User: Yes
Bot: Great. Appointment has been set. (Response from Fulfillment)
Bot: Anything else you need help with? Yes | No (How to achieve this)
I have tried triggering followupEvent but that won't display any response till the chain of intent is complete.
When the followupEventInput parameter is set for a WebhookResponse,
Dialogflow ignores the fulfillmentText, fulfillmentMessages, and
payload fields. When Dialogflow receives a webhook response that
includes an event, it immediately triggers the corresponding intent in
which it was defined.
I have End Intents ready for response for Yes and No. But need help in triggering it.
An intent shouldn't be used as a step in your flow or be tied to a single response, its intended to represent a category of phrases your user might say to complete a certain goal in your conversation. Since the was this helpful isn't triggered by any user phrase, but more as a trigger for the user to continue the conversation shows that it shouldn't be a separate intent.
Having the was this helpful phrase be available to multiple intents is a good choice so it can be used throughout your conversation, but I would recommend saving this phrase in a file, an API or a CMS and retrieving the response via code.
I'm not a PHP developer, but I expect it to be along the lines of: responseService.getResponse("requestFeedbackPrompt");
This allows you to retrieve the was this helpful phrase throughout your code, without making the mistake of making a seperate intent for it, as this will create problems later on with keeping state.
If you would decide to go with a single intent for this, you will quickly see that it will become difficult to maintain track of context, states and which step of the conversation you are in as multiple intents will go through this generic intent.
What would you do if you need a different variant of the was this helpful response, with the single intent, you will end up creating an intent for each variation and you will have to align the conversation flow and state accordingly every time.
If you use the service, you just call responseService.getResponse("OtherFeedbackPrompt);`
Hi have something similar in one of my bots. I have taken a different approach to those mentioned.
My bot asks if there's anything it can help with at the end of a an acknowledgement fulfilment.
The customer then has the option to respond with Yes or No.
Within the page that asks the question I have created routes.
One route for Yes and another for No.
The Yes route directs customers back to the point where they can start making selections. The No route provides a fulfilment to the customer and ends the session. I have used Yes and No intents for these.

Is there any possibility in triggering the intent without the help of Training phrases?

I have created 5 intents in a Dialog flow. After completion of first intent, it should automatically go to the second intent without the use of the training phase. Is there any possibility to do that?
This probably isn't what you want to do. Remember that Intents capture what the user says or does and not how Dialogflow should respond.
If you want to do a series of things when the user says one thing, then you can do all those things in your fulfillment webhook. Your webhook is where you actually do something based on what the user has said, and this can be handled in one function call or several calls that you make from your Intent Handler.
There are two possibilities either you can use contexts or if you want to handle sequence from webhook service you can use events.
For webhook solution,
Give each Intent a specific event and action.
In your webhook request you will get action of your intent and you can trigger next event based on current action. => Dialogflow
For context solution
You can add Follow up intents for your each intents, Follow-up-intents

Dialogflow - handling inputs with multiple intents

I'm designing a helpdesk chatbot in dialogflow and currently training it with existing data from my ticketing system. What is the best practice for handling inputs that contain multiple intents? Here is an example with the intents in bold:
"Hi, my name is John Doe and I'm a first year student. I want to know where to register for classes and also reset my enterprise password. Please help."
So is the solution to ask people to keep things simple up front? I think currently dialogflow will point the user to one of the intents above, but i'm not sure how it decides which intent to match with.
You will probably have one intent for each feature that your bot offers, i.e. RegisterClass, ResetPassword etc. In that case there is no good* way to handle the case where someone asks for two things at once, your users will have to limit themselves to one request at a time. You can however use a fallback intent to explain this at runtime. This intent would be triggered if a users utterances matches none of the other intents and could give the user a quick explanation like
"Sorry, I didn't get that. Please tell me what you would like to do,
e.g. 'register a class' or 'change my password'"
This would keep a natural conversation going and alleviate the need to "train" users specifically for your agent.
*You could of course add combined intents like RegisterClassAndChangePassword, but that would become very clumsy and most likely not work reliably. You could also try to parse the request in your backend, but then you would essentially circumvent Dialogflow's core feature.

Permission response not handled correctly

Following this command in node.js using the ApiAiApp module:
app.askForPermission('To know what day it is where you are',
app.SupportedPermissions.DEVICE_PRECISE_LOCATION);
I get the following in the Actions on Google Simulator.
It correctly prompts for my response, but then is confused and doesn't recognize my answer! Is there something missing or broken in my API.AI agent? After the askForPermission, there are no other fulfillment calls.
The problem is likely that you need to set an Intent that will be triggered when the permission is granted. You do this by setting the Event to actions_intent_PERMISSION.
This will look something like this:
You can set the Action to whatever makes sense for your webhook, and be sure to enable webhook fulfillment for the Intent as well.
If you need to keep track of where the permission request was initiated from, and handle it through a different Action, you can set a Context and have different handling Intents based on different Context settings.
The Fallback Intent method works because there is no better match at that point since you hadn't specified a regular Intent with actions_intent_PERMISSION. It isn't the best choice, however, since it could match other situations from your user.
The concept that I was missing is mentioned here.
All you have to do is create a child fallback intent for the intent
you are requesting permissions from.
So if you have a few intents that ask for permissions, each of them need their own fallback intent.

Creating Follow Up intent in API.AI

I am trying to create a Chatbot through API.AI. Now my chatbot has a flow and it responds based on the users query. So I have created many Follow up Intents. But my follow up intents are not connecting. It is returning the same respinse for the initial question. Where did i go wrong?
Would help to see what your intent looks like. From what you're saying though, it may be that the previous question is not getting the answer its looking for so it will just continue asking it until it does. Check your entity value under action within your intent.

Resources