wit.ai - unrecognised user entries

2019-05-20 20:02发布

问题:

is it possible to have a catch-all for unrecognized user entries to move the user into a particular story?

For example in a conversation. If there are no matching stories the bot will respond to try and push the user back on track?

[user] Hi how are you

[bot] good, how are you?

[user] great

[bot] that is good

--- user enters an un-matched sentence ---

[bot] I did not understand you. Would you like to order a pizza?

[user] yes

...etc

回答1:

I don't know if it's the best solution but I do the following:

1) Create a story without intent to catch the "no matching stories".

2) The bot answers: "I did not understand you. Would you like to order a pizza?"

3) Yes/No handling https://wit.ai/docs/recipes#handle-yesno-answers

4) If yes, create an action call "jumpToPizzaOrderingStory". On your side, this action "emulates" the fact that the users sent "I want to order a pizza" that will triggered your PizzaOrdering story.