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

喜你入骨 提交于 2020-01-06 07:18:09

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/46434170/how-to-use-prompts-text-without-triggering-new-intent-in-microsoft-bot-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!