Search code examples
dialogflow-esfallback

how to handle the wrongly capture input from user in dialogflow?


I have created a chatbot using dialogflow using four intents and I am passing contexts form one intent to another intents .

  1. welcome intent
  2. GetName intent
  3. GetEmail intent
  4. GetDOB intent

I wanted to know how to call fallback intent if user entered wrong name. It should call GetNameFallback intent , for wrong email it should call GetEmailFallback intent. For wrong DOB it should call GetDOBFallback intent.

For each specific intent it should call its specific Fallback intents

Here is the list of contexts I am passing:

  1. (welcome intent) - output context : awaiting_name

  2. (GetName intent ) input context : awaiting_name and output context : awaiting_email

  3. (GetEmail intent ) input context : awaiting_email and output context : awaiting_dob

  4. (GetDOB intent ) input context : awaiting_dob


Solution

  • From the Dialogflow docs: "When you create an agent, the Default Fallback Intent is automatically configured with a variety of static text responses, like "I didn't get that. Can you say it again?" and "Sorry, what was that?" This intent is matched when your user's input does not match any other intent; in other words, it's a kind of catch-all for any unrecognized user input.

    For example, say that your agent has only one custom intent named weather that recognizes user input like "What is the weather today?" or "Forecast tomorrow". If a user speaking to your agent says "I like the color purple", your Default Fallback Intent is matched because the agent isn't able to match the input to the weather intent."

    Based on that information, you might try training your agent to match an incorrect name / email to an intent like Fallback Intent - Name or Fallback Intent - Email, where those intents reprompt the user for the name again.

    Without seeing your fulfillment code, it's hard to say for sure whether or not this strategy will work. If you update your question to include your current fulfillment code, you might get a more relevant answer.