How to handle Fallback Loop in DialogFlow?

Viewed 2270

There are two loops here:

  1. Re-prompt from DialogFlow when user is not entering correct value for slot
    eg.

    Bot: What is color of your car?
    User: potato
    Bot: What is color of your car?
    User: tomato
    Bot: What is color of your car?
    ...

  2. Getting fallback intent replies from DialogFlow
    eg.

    Bot: What is your car brand?
    User: red
    Bot: Sorry, could you rephrase.
    User: red red
    Bot: I did not understand, could you say it again.
    ...

How to come out of these scenarios? There is no provision of setting number of re-prompts.

Thanks to @Abhinav, I got one approach of using outputContexts to solve this issue, however I am getting many cases to get this working as described in below pic: enter image description here

But I am getting confused whether I should increment the counter or decrement it. As output contexts also gets decrement with every call.

1 Answers

You need to maintain that by yourself. For Action on Google you can look into following example https://developers.google.com/actions/assistant/reprompts

For Dialogflow:

  • Create a parameter, "re-prompt"
  • Check it in fallback intents.
  • increment it in fallback.
  • reset or decrement it in other intents.
  • if it is greater than 2, you may exit the conversation by letting the user know that you are unable to process at this time.
Related