Prompt for Text Without Routing

不想你离开。 提交于 2020-01-03 02:26:16

问题


What I'd like to incorporate into my bot is a way to prompt the user for essentially free-form, natural language text and then save it.

I thought this would be simple enough using:

builder.Prompts.text(session, prompt);

But it appears the UniversalBot is attempting to interpret and route based on the text supplied by the user.

I do have LUIS wired into the bot as the recognizer and it's clear that's what is coming into play here because it's resolving to one of my defined intents. Or at least it's saying it recognizes that intent but it doesn't actually take the user to that dialog.

Is there some way to achieve what I'm after? Essentially disabling the recognizer while receiving the response to a prompt?

I'm coding in Node.


回答1:


You can disable the LuisRecognizer by using .onEnabled(). You can find an example here on it in action. You'll need a condition to to enable and disable the LuisRecognizer, which could be checking the dialogStack, or setting a property inside of session.conversationData.

Alternatively, if you're okay with triggering the None intent, you can use .onFilter(). This will allow you to change the recognized intent to the None intent. Your condition here would be checking to make sure the dialogStack is empty. You can find an example for onFilter() here.



来源:https://stackoverflow.com/questions/45765960/prompt-for-text-without-routing

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