Reputation: 122
I'm a newbie in need of certain help in Dialogflow. I have three intents (they're actually way more than this) with both of them having follow-ups, allow me sketch below.
I will call the 1st Intent - "Head" , 2nd Intent "Chest" , 3rd Intent "Back"
Say 1st intent is triggered when someone says "I have a head rush", a couple of follow ups will come along that line like "how long does this take", "when did this start" ...... and more till the last follow up of this intent, thereafter the agent will ask if the user has problems with "Chest" hence triggering the 2nd intent or could as well ask if the user has problems with the "Back" triggering the 3rd intent.
Moving on, say the agent asked about "Chest" which triggers 2nd Intent which as well has its own follow ups and also i set it up to ask about the other problems as i did for the 1st Intent (in this case "Head" or "Back").
My question is how do i let the agent not ask about "Head" (which was already asked in the 1st instance) and only go for the remaining instance which is "Back"?
I hope i have phrased this in an understandable way.
Any workarounds will really be appreciated, thanks in advance
Upvotes: 0
Views: 328
Reputation: 132
You may want to look into contexts.
https://dialogflow.com/docs/contexts https://dialogflow.com/docs/contexts/input-output-contexts
So how it works essentially is, if you have an intent with an input context, it won't trigger unless that specific context is active. You can create and set the duration of a context in an intent, in the output context section.
So if you're in the middle of the conversation for chest is, you don't want to have the input context for chest or back active so their related intents won't trigger.
Only after the last step of chest is handled, you can start the input context for Back and in the output context, set the lifespan of the chest context to 0, so it ends. This ensures that Chest related intents will not trigger again.
This is assuming you want to handle these conversations in a sequential, if you want it to be more dynamic, where the order of questions doesn't matter. It's going to be a lot more difficult.
Hope this helps!
Upvotes: 2