Will
Will

Reputation: 381

How to get Dialogflow to trigger an intent with ANY input without using fulfillment

Not much to add to this question I don't think. Basically, I have a series of questions the user needs to answer, but they are veeeery open-ended, so the user input could be pretty much anything. Once the user responds to a question I want the system to simply ask the next one, regardless of what they said (unless they say something like "help" or "I don't understand", etc, which I can deal with).

I know I can include contexts, but without supplying the next intent with adequate user input, there doesn't seem like a way to get it to trigger the next question (even when the output and input contexts match).

Is there something I'm missing, or do I really need to just supply dozens and dozens of potential user inputs from across the board and hope the machine learning component extrapolates adequately?

Upvotes: 3

Views: 2609

Answers (1)

Prisoner
Prisoner

Reputation: 50701

For open-ended responses, the easies way to handle this is through Fallback Intents. You can create more than one Fallback Intent - but each one needs to have a different Input Context which will indicate under what conditions it will be triggered.

To be clear - Fallback Intents are slightly different than regular Intents, and you create them slightly differently as well. In the most simple configuration, they are only triggered if the user input does not match the input for any other Intent. Dialogflow provides a "Default Fallback Intent", which is what will be triggered if no other Intent of any sort matches. You'll need to set the Input Context of your Fallback Intents to indicate when it should handle it with that Fallback Intent and then also set the Output Context to indicate which question you have asked and, therefore, what the next expected Fallback Intent will be.

To create a Fallback Intent, don't click on the "Create Intent" button, instead, click on the three dots next to it.

enter image description here

In the menu that appears, click "Create Fallback Intent"

enter image description here

The screen that shows is very similar to a regular Intent editing screen, but it is specifically for Fallback Intents. You'll do the usual things about adding the name and (not shown) showing the replies (ie - the next questions you'll be asking).

You can tell it is a Fallback Intent because of the message at the top. As noted, you should then enter the Input and Output Contexts you plan to use for this.

You will notice there is a "Training Phrases" section. In your case - you will leave this blank. These are actually Negative Training Phrases - phrases that will not match other Intents (even if they should) and will always be handled by the Fallback Intent instead. Since you aren't trying to mask out phrases that might match elsewhere - leave it blank.

enter image description here

Upvotes: 6

Related Questions