Reputation: 21
I have an intent configured where a user can ask about resetting their password. My bot successfully picks up that the user is asking about a password reset and responds correctly. The bot provides the user with help on how to reset their password and then asks whether they want to log a support ticket. When they type the utterance "Create ticket" the second intent is triggered.
The second intent asks the user for their email address, customer id, and description of the ticket.
All works well until the user types in the description and the bot invokes the first intent regarding the password reset and again provides the user with help on resetting their password.
Is there a way to prevent the first intent fro triggering whilst the user is typing the description as part of the questions in the second intent?
Upvotes: 2
Views: 993
Reputation: 3277
Unfortunately there is not a way to force Lex to ignore intent utterances, but Lex is smart enough to attempt to recognize at the slot level before checking the intent level.
I also have some similar situations where a slot elicit is also an intent utterance, but I've found that if the slotType
values include those possible intent utterances, then Lex does a good job of checking and filling the slot before checking for a match in intents.
So with that in mind, here are a few options I would consider:
A.
Auto-fill the beginning of the description
based on the previous IntentName
or the phrase that triggered the intent. Then ask if they want to add to it in the elicit of description
. That way, they would not need to repeat the phrases that trigger the intent. I would write the elicit prompt something like this:
In the description of this ticket I have already written "Resetting password." What else would you like to add to the description?
Even asking them to finish the sentence might work well:
Please complete this sentence to be added as the description of this ticket, "I am resetting my password because..."
B.
Add all of the intent utterances as one of the description
's slotType
values. This way, Lex will recognize the words used in the description as filling the slot before checking if they match an intent utterance.
C.
I would consider limiting the description, or even building the description from multiple slots. For example, maybe each description should include (1) reason, (2) priority/importance level, etc. And so build a slot for "reason" and "priority" and elicit those specifically with:
What is your reason for resetting your password?
What level of priority do you give this ticket?
Then in Lambda put those (and any others) together into a description.
Upvotes: 2