提示输入文本而不进行路由 [英] Prompt for Text Without Routing

查看:56
本文介绍了提示输入文本而不进行路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想结合到机器人中的一种方式是提示用户输入自由格式的自然语言文本,然后将其保存.

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);

但是,UniversalBot似乎正在尝试根据用户提供的文本进行解释和路由.

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

我确实将LUIS作为识别器连接到机器人中,很明显这就是在这里发挥作用,因为它可以解决我定义的意图之一.或者至少是说它识别出该意图,但实际上并没有将用户带到该对话框.

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?

我在Node中编码.

推荐答案

您可以使用.onEnabled()禁用LuisRecognizer.您可以在 此处 .您将需要一个条件来启用和禁用LuisRecognizer,这可能是检查dialogStack或在session.conversationData内设置属性.

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.

或者,如果您可以触发None意图,则可以使用.onFilter().这将使您可以将识别的意图更改为None意图.您的条件是检查以确保dialogStack为空.您可以找到onFilter()的示例 这里 .

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.

这篇关于提示输入文本而不进行路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆