Why is Dialogflow is asking the same follow-up intent twice? - dialogflow-es

I created a very simple Dialogflow project for the first time and I am having a problem with one of my follow-up intents. It asks the same follow-up question twice.
enter image description here
I am testing this inside Dialogflow. Do you have any suggestions I can try?
Many Thanks

The issue boils down to how Followup Intents work under the covers and the mechanism that Dialogflow uses to enforce them.
They work because the Base Intent will set an Output Context, and the valid Followup Intents are only triggered for the same Input Context. So the check intent sets a check-followup context, and the check-no intent depends on the check-followup intent being set. Similarly, the check-no intent sets the check-no-followup context and check-no-no intent expects the check-no-followup context to be set.
However, the lifespan of these Contexts are set to 2 initially, and this is decremented each time an Intent is handled. So after the check-no intent is processed, we will have two contexts that have been set: check-followup and check-no-followup.
This becomes a dilemma when the user says "no" again. That matches two Intents, and both of those Intents have a Context that is valid at that time: check-no (because the check-followup context is still active) and check-no-no (because the check-no-followup context has just been made active). Since more than one Intent could be valid - it is indeterminate which one would be called. This is why it would work for other test cases you had been trying.
In your case, a reasonable solution would be to make sure which context of these two you expect to be valid at that point. In this case, it would make sense that you turn off a Context after the Intent that you expect to match them does. So this means that if the check-no context is triggered, then you would set check-followup as an output context with one important distinction - you should explicitly set the lifespan of it to 0. This would remove that context, so there is no confusion about which Intents are available to handle the user's next reply.

Related

How can I keep Dialogflow followup intents nested when adjusting default contexts?

We're developing a system that encapsulates content through context. The context names that Dialogflow generates aren't very readable, so we've been adjusting them in the files directly.
This works for a batch of content, but when we add a new followup intent, it inherits an automatically generated context. When we adjust that context in the file directly, it dissociates with the parentID and rootParentID.
Is there a way to keep these followup intents nested in the console? It would make large volumes of content easier to manage.
Thank you.

Calling followup intent multiple times

I am working on a estimate tool for google actions where I want the ability for the user to change individual values after they get an initial estimate. Currently I am using follow up intentions to update values and then invoke the estimation intention, it seems to fail always. I think it is related to contexts. Is there a good resource to understand contexts and debug for them?
If you are using Followup Intents, you're certainly getting tangled up in Contexts. Google's documentation is simple, but covers the issue well.
Without seeing your Intents specifically, it is difficult to see what you're doing, how you're trying to do it, and what problem you may be encountering. However... Followup Intents are not usually good for long chains of questions and answers, particularly if you're expecting the user to go back and correct some of the answers.
Instead, you should leave them as top-level Intents, either triggerable only in specific contexts, or triggerable at any point (or both) depending on exactly what your conversation sounds like.

dialogflow context vs. intent - Design Choice

I started working with Dialogflow a couple of weeks ago. It's nice to learn the concept of intent and (input/output) context through which Google models and defines the daily conversation flow in natural language. I understand how intent and context work at the current setting. But to me the function of context can be achieved by only using intent. You may argue whether the word 'intent' is proper for this usage but it's another discussion. So instead of input and output context just do input and output intents. In the implementation make sure the parameters and information of current conversation is carried to the following intent. And the following intent has again its output intent and the talk continues.
Can anyone correct me if I'm wrong?
Intents represent a user action, typically what a user says, including the parameters from that specific utterance.
Contexts serves two purposes:
Hold the parameters from an Intent or that have been set through Fulfillment for some period of time.
When used as an Input Context, limit what Intents can be triggered.
While you can certainly "send the parameters forward" from one Intent to another, this is a very linear way of thinking, and rapidly falls apart in complicated conversations. Using Contexts to store parameters and other info, as the first bullet suggests, makes this a lot easier, so your user can wander around in the conversation, and yet you are still maintaining the overall state.
As for the second bullet, this is used to change how we understand what the user has said based on other parts of our conversation. (This matches how humans handle conversations.)
So my response saying "Yes" means different things depending if I'm asking to delete a message or send a message - Contexts help us manage that.

When using Dialogflow, what's the difference between follow-up intent vs requiring a parameter in the parent intent?

In this video https://youtu.be/ADD-rvsS5z4?t=927 the presenter demo the creation of a bike shop appointment booking app. The presenter uses Follow up intents to ask user what type of appointment ("Service" or "Repair"?). Can we not do this through having appointment type as a REQUIRED parameter, under the parent intent. I guess the question then becomes, what's the difference between using Follow up intent and setting a parameter as required?
They are two sides of slightly different coins. Each has uses and tradeoffs, and which one you choose to use depends on how your conversation is structured.
First - always remember that an Intent is meant to capture what the user has said. Not what we are saying or doing with that information.
Required parameters determine what needs to be included in the message from the user. If the parameter is not provided by their statement, they can include a prompt that we will give to get that information.
However, sometimes parameters are only required if other parameters are included, or aren't set. For example, you may find it useful for the user to either say "I'd like an appointment tomorrow morning" or "I'd like an appointment at 10 am tomorrow". "Morning" and "10am" are two different parameters (one is more specific than the other), but you would like one or the other expressed. This can't be done using required parameters.
But if it is omitted, we can use fulfillment to prompt the user for more information. For example, we could then ask "Do you want it in the morning, afternoon, or at a particular time?" and then have followup intents setup to capture this reply. But followup intents aren't perfect, either.
What if the user replies with a question, such as "when is available in the morning?" Could our followup intent confuse this with a reply? Quite possibly. Or there might be some additional back and forth before they specify a time. In cases like these, you don't want narrow followup intents, but you do want broader conversational intents that could be triggered at any point in the conversation, but still retain the context of the appointment that is trying to be set.
For these reasons, I tend to suggest that you not worry too much about either required parameters or followup intents. While both have some specific uses, more generally, having other intents that can handle these same questions is best. You can make sure the most appropriate ones are triggered by setting Contexts for when they will be valid. (Followup Intents use Contexts under the covers.)

Follow-up Intents for Dialogflow

This is the sample conversation. I am encountering a problem linking Follow-Up Intent (4) back to Follow-Up Intent (1).I am creating a DialogFlow agent. In this agent, there are two community clubs with their respective events, courses and facilities. My idea is to create an intent each for both community clubs. Within each intent(1), there will be three follow up intents(2), and within these intents there will be their respective information(3) (e.g. time, date, venue etc).
Within the follow-up intent (3), the users have to answer a series of yes or no follow-up intents (4). Basically the idea is that the follow-up intents will go pretty deep in, as such is there a way to link follow-up intents (4) back to follow-up intents (2)?
I hope this is not too confusing. Hope to hear from you soon!
Best Regards

Resources