如何在传递上下文的LuisActionDialog中从一种意图跳到另一种 [英] How to jump from one intent to another in LuisActionDialog passing context

查看:46
本文介绍了如何在传递上下文的LuisActionDialog中从一种意图跳到另一种的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft Bot Framework,LUIS和

I'm developing a bot with Microsoft Bot Framework, LUIS and LUISActionBinding.

在我的LUIS应用程序中,我有3个主要意图: BuyX FindA FindB .该机器人的主要目标是帮助用户购买X,但是他们可能想先使用某些过滤器搜索A或B,或者直接去购买X.

In my LUIS app I have 3 main intents: BuyX, FindA and FindB. The main goal of the bot is to help users to buy X, but they might want to first search for A or B with some filters first, or just go directly to buy X.

我使用必填字段和可选字段为每个意图设置了动作,一切运行良好,并且我能够接收意图处理器的动作所返回的对象.

I set up the Actions for each intent with the required and optional fields, everything works great and I'm able to receive objects returned by the actions my intent handlers.

在FindA处理程序中,我帮助用户选择一个A,在FindB处理程序中,我帮助用户选择一个B.在BuyX中,我需要A和B的信息才能继续.但是,如果用户执行了FindA或FindB对话框,我想重复使用到达那里的内容.

In the FindA handler I help the user selecting one A and in the FindB handler I help the user selecting one B. In BuyX I need info from A and B to proceed. But if users did the FindA or FindB dialog I want to reuse stuff I got there.

我的问题是我如何才能从意图FindA触发意图BuyX,以便使代码到达我的BuyXAction类 ,并且已经根据我从FindA action + intent获取的内容分配了一些属性.

My question is how can I trigger intent BuyX from intent FindA, so that the code reaches my BuyXAction class with some properties already assigned based on what I was able to acquire from the FindA action+intent.

通过这种方式,用户无需在"FindA"对话框中输入任何他想购买X的内容,也不必重复自己已经做过/选择的事情.

This way the user wouldn't have to type anything saying he wants to buy X nor repeat stuff he already did/select during the FindA dialog.

谢谢.

推荐答案

我相信SubActions的概念可能会对您有所帮助.看看这个

I believe that the concept of SubActions might help you here. Take a look at this documentation topic to find more about how it work and some code highlights.

触发没有先前上下文(即来自)的上下文操作 从头开始)

Trigger a Contextual Action with no previous Context (ie. from scratch)

用户可以提供将触发上下文动作的输入 (没有当前上下文).该框架通过以下方式支持此方案: 提供一种为其实例化上下文链的方法(即 提供的父级操作链将提供整个上下文), 最后执行请求.

The user can provide an input that will trigger a contextual action (with no current context). The framework supports this scenario by providing a way to instantiate the contexts chain for it (ie. the chain of parent actions that provides will provide the whole context), and finally executes the request.

这篇关于如何在传递上下文的LuisActionDialog中从一种意图跳到另一种的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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