In some specific cases you may want to capture a text that is not necessarly in your intents. It can be a problem description, the user name, an address,... any unpredictable text
In thoses cases you will want to bypass the NLU and continue the dialog whatever the user message
Here is how you can do it
In your dialog flow, at the step where you need to ask for free text, add a "Bot Sows" object.
Then click on
Show more options to view the advanced settings
NLU bypassing feature and define a bypass phrase.
Note: This phrase will be used by the NLU instead of the real user input so pick a quite complex phrase that should not come easily in the discussion. in this case we have chosen
Free text NLU bypass phrase which has really small chances to occur accidentally in a conversation.
Now we can add the next steps of our dialog flow with the following objects:
- a "User says" object to detect the bypass phrase
- a "Bot says" as the next bot answer, you can keep it empty
- a "Bot does" where you put two lines of code to capture the real user input and use it as you want
We create an intent with the exact same bypass phrase that you have defined before and train your bot.
Here is a sample code that you can use in your "Bot does" object. Most important thing to remember is that the user input will be available in a variable called
var name = output.input; output.answer = 'Nice to meet you ' + name;
Once finished, here is the result that you will get.
Pretty cool huh?
Although your bot has never been trained to learn first or last names, he will accept the text provided by the user in this context as a name and smoothly continue the conversation 🙂
Updated 3 months ago