LUIS API - 意图依赖 [英] LUIS API - intent dependency

查看:71
本文介绍了LUIS API - 意图依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

首先,使用luis API摇滚聊天机器人!

First of all, working on a chat bot with luis API rocks!

在我的聊天机器人上,有动作  (绑定到意图)我只允许在登录后做,我无法弄清楚如何获得意图,如果用户未登录,则将他/她的
重定向到另一个意图。

on my chat bot, there are actions (bound to intents) that I allow to do only after login and I can't figure out how to get an intent and if the user is not logged in, redirect him/her to another intent.

例如,我创建了一个intent" getCustomerOrderDetails"在我的代码中,我看到IBotData.CustomerInfo为null。所以我想回复一个答案"你打电话登录,用户名和密码是
",用户名和密码将是另一个意图"登录"
的行动参数

for example, I created an intent "getCustomerOrderDetails" and in my code, I see that IBotData.CustomerInfo is null. so I want to return an answer "you shold log in, with is your username and password", and the username and password will be parameters of an action from another intent "login"

那么,我该怎么做?

Vido

推荐答案

我的建议是不要"滥用"意图。在you  getCustomerOrderDetails中,您检测用户是否已登录。

My advise would not to "abuse" the intents. In you getCustomerOrderDetails you detect if a user did is logged on.

如果是,您可以启动一个方法来处理操作并创建响应。

If it is you can start a method to handle the action and create a response.

如果不是,您可以使用PromptDialog.Text(上下文,LoginFunction,"您的用户名/密码是什么。请输入< username> ;;< password>"");

用户获取数据中的猜测和类型。您将被带到LoginFunction并回复,您可以决定是否正确。当你指导用户使用相同的方法来处理动作并创建响应时。

If it is not, you can use a PromptDialog.Text(context, LoginFunction, "What is your username / password. Please type in as <username>;<password>");
The user gets the guestion and types in the data. You are directed to LoginFunction with the reply and you can decided if is correct. When it is you direct the user to the same method to handle the action and create the response.

希望这会有所帮助:

如果这个回复回答您的问题请将其标记为答案,以便我们可以帮助其他人。
If this reply answers your question please mark it as answer, so we can help others.


这篇关于LUIS API - 意图依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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