1
votes

I've created 2 intents.

Intent 1:

Training phase = 1) the sky is blue
Input context = empty
Output context = empty

Intent 2:

Training phase = 1) raise an incident (and etc)
Required param = 1) param-A (entity;value=orange,watermelon,mango)
Input context = empty
Output context = "RaiseIncident"

Steps to simulate:
1. User key in "raise an incident".
2. Intent 2 will be triggered and prompt for the param-A.
3. User key in the sky is blue
4. Dialogflow stop capturing the param-A and return the response in intent 1.

Here is my questions:

Is there any way to continue to capture the param-A until the correct input(orange, watermelon, mango) is entered instead triggering other intent? Or is this the standard behavior of Dialogflow?

1

1 Answers

0
votes

This is the standard behavior, and is there for a very good reason.

Let's say you have the "raise an incident" Intent the way you describe it, and the required parameter is for incident type. So if not provided, it prompts: "What is the incident type?"

U: Open an incident
B: What is the incident type?

What do you do if the user doesn't know what the possible incident types are? Perhaps you'll give them an Intent where they can say "Help" or "What types are there?" or the equivalent. But if it only accepts valid incident types, then it will keep rejecting the requests for help. So under your scenario, the conversation might sound like

U: Open an incident
B: What is the incident type?
U: Green
B: What is the incident type?
U: Help
B: What is the incident type?

But since you can create a "Help" Intent, then you can provide that information and they can re-trigger the Intent to raise the incident.

U: Open an incident
B: What is the incident type?
U: Help
B: You can open mango or apple incident types. What would you like to do?
U: Open a mango incident

While required parameters in Dialogflow seem like a good thing, it doesn't really work well in a number of cases. Better would be to make it an optional parameter, so you capture it if they tell it to you up front, but if values you need are missing - prompt for them and set the Context so you're recording you're prompting for something. Then you'll be able to add Context-sensitive help or fallback handling.