Two different intents with the same training phrases - DialogFlow. How to ensure both intents get used

Viewed 328

Hi so I have a problem.

In Dialogflow, when I get a response to end the chat, I would like to ask the user for ratings.

so I've created 2 intents, "endchat" and "endchat2."

They both have the same training phrases, but it appears only endchat2 is being used (the most recently created intent)

How do I ensure that the chatbot randomly chooses an intent after a given response, instead of only using one intent? They have the same training phrases.

An alternate idea is in the attachments. The problem lies that I want the custom payload to only to appear after one of the text responses, (that being text response #1,) but not appear, if the chatbot decides to use text response #2. This is the reason I decide to make two separate intents, but it looks like that's not helping out because the bot is only using one intent.enter image description here

2 Answers

Remember, Intents represent what the user says and does and not how you respond to that. So there is no way to "randomly choose an Intent" to use to respond.

What you can do, however, is setup a webhook for that Intent and determine how you wish to respond to what the user says. In some cases, you can thank them and end the conversation, while in others you can thank them, ask them the followup question, and set a Context so you can expect their reply.

Having the same / similar training phrase in multiple intents is an anti-pattern of bot design. Ultimately this confuses the bot and it leads to undefined behavior.

This should also trigger an warning in "Validation" with something like "Multiple intents share training phrases which are too similar:..." on the intents.

Related