edo
edo

Reputation: 1869

How to use Prompts.text without triggering new intent in Microsoft Bot Framework

I have multiple dialogs that are triggered with triggerAction. I use LUIS to trigger/match utterances to specific dialogs.

Each dialog has two steps (functions):

  1. if entities are valid query DB and end dialog, else prompt user for one of the missing entities with Prompts.text() and continue to next step
  2. set dialog state and repeat dialog from step 1 with next() *

My problem is that for some prompted inputs (i.e. entity values) LUIS will trigger new unrelated dialogs. In these cases the dialog stack is lost (since I use triggerAction) and the conversation flow is broken.

How can I ensure that the prompt for missing entities will not trigger a new dialog? Is my conversation flow flawed?

I already have many trained utterances for each intent. I'm guessing my LUIS model is "loose" enough to match multiple word entities (entered after the prompt) to (short) intent utterances.

* From the docs: When a bot reaches the end of the waterfall without ending the dialog, the next message from the user will restart that dialog at step one of the waterfall.

Upvotes: 0

Views: 670

Answers (1)

Steven G.
Steven G.

Reputation: 1642

You can use LuisRecognizer.onEnabled() to disable your LUIS calls while you're in the middle of a dialogStack, or even in the middle of a dialog. This will solve the issue of intents being recognized while you're in the middle of a Prompt.

Here's an example I wrote on implementing the method when using a RegExpRecognizer (.onEnabled() is inherited from IntentRecognizer).

Here's an answer to a Stack Overflow question that I wrote.

Upvotes: 1

Related Questions