如何将Luis挂钩到Bot Framework FormDialog中

问题描述:

我有一个Dialog类,它是一个FormDialog(例如,FormDialog< SandwichOrder>;根据bot框架文档网站,该类可为三明治构建订单). SandwichOrder包含一个"Price"属性.

I have a Dialog class which is a FormDialog (say, FormDialog< SandwichOrder>; one which builds an order for a sandwich, as per the bot framework documentation website). The SandwichOrder includes a "Price" property.

我还有一个Dialog类,该类从LuisDialog派生而来,该类获取价格(基于大小和/或省份).

I also have a Dialog class which derives from LuisDialog which gets the price (based on, say, the size and/or province).

如何将 Luis 功能连接到表单对话框"中?

How can I hook Luis functionality into a Form Dialog?

当前无法在表单字段步骤中调用对话框.但是,您可以使用形式(在本例中为价格")的自定义IRecognize实现字段,并在IEnumerable<TermMatch> Matches(string input, object defaultValue = null)实现调用中对Luis模型进行调用,并根据Luis检测到的实体返回所有可能的TermMatches.

Currently it is not possible to call a Dialog in a form field step. But you can have your custom implementation of IRecognize for a Field in the form (in this case "Price") and in the IEnumerable<TermMatch> Matches(string input, object defaultValue = null) implementation call into your Luis model and return all the possible TermMatches based on the detected entities by Luis.