How to handle Luis intent with parameters with prompt

久未见 提交于 2019-12-18 09:24:34

问题


I have an intent in LUIS with several required parameters. I also set prompt for these parameters so that when they are not detected, LUIS asks for them. However in the BOT, I always get them as null when they are not specified.

The bot is not asking for the lacking parameters (even if the Prompts are set in Luis). Why? Is there a way to get the prompts automatically? Or is that still not supported in MS Bot Framework? I'm using C#


回答1:


Based on your comment it seems you are using an older version of the Nuget package. Make sure to update to the latest BotBuilder version. Current version is v3.5.

In the latest versions, the BotFramework team added support for LUIS v2 API and added some brand new capabilitites. I'm pretty sure that V2 is now the default in the latest versions, but even that, the LuisModel attribute now accepts the API version besides the ModelId and the ModelSubscriptionKey

For example, now the LuisDialog will act if your intent requires parameters and those are not provided. In that scenario (which it seems is yours), the LuisDialog will automatically launch a LuisActionDialog and ask the user for the missing parameter, using the Prompt message you defined in the action parameter on the LUIS frontend.

BTW, to check for the action, you can to navigate through the actual intent. The IntentRecommendation has an Actions collection property.

The image below shows the full tree, including Action Parameters.



来源:https://stackoverflow.com/questions/41697566/how-to-handle-luis-intent-with-parameters-with-prompt

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