简体   繁体   English

如何通过对话流意图进行while循环?

[英]How to make a while loop by dialogflow intents?

I have the following intent and followup intents for a user login process: 对于用户登录过程,我具有以下意图和后续意图:

PIC1

PIC0

PIC2

PIC3

PIC4

How can I set a while loop for this login process in order to continue asking user email while user enters email address incorrectly and after he/she enters it correctly the getting password intent triggers? 我如何为该登录过程设置一个while循环,以便在用户输入错误的电子邮件地址以及正确输入密码后继续询问用户的电子邮件,从而触发输入密码的意图? In my cases after 2 incorrect entry, api.ai will response "Not Available". 在我的情况下,两次输入错误后,api.ai将响应“不可用”。

Forcing users to respond to a question without giving them recourse to cancel, move to another part of your conversational interface or speak about another subject is user-hostile and I'd recommend doing exactly what Actions on Google forces you to do in this situation: end the conversation after a few failed attempts. 强迫用户回答问题而无权取消,移至对话界面的另一部分或谈论另一个主题是对用户不利的,因此我建议您在这种情况下完全按照Google的措施执行操作:几次失败尝试后结束对话。

Conversational interfaces are best thought of as designing actual conversations. 对话界面最好被认为是设计实际的对话。 In a normal conversation asking the same question multiple times regardless of what someones says to you would largely be considered annoying at best. 在普通对话中,不管有人对你说什么,多次问相同的问题,在很大程度上充其量只会令人讨厌。 Consider revising your Dialogflow agent to allow logged-out conversations explaining to the user what your agent can offer and why login is required for certain features. 考虑修改Dialogflow代理,以允许注销的对话向用户说明代理可以提供什么以及为什么某些功能需要登录。 If the user repeatedly asks for a feature that requires login but refuses to do so, the conversation should end. 如果用户反复要求提供需要登录但拒绝登录的功能,则对话应结束。

Another note here: I'd recommend against using passwords through conversational interfaces. 这里的另一个注意事项:我建议不要通过对话界面使用密码。 Most conversational platforms have a way to sign in (eg Google Assistant/Actions on Google ) or you can safely assume the user is using a device where they have access to a web browser as well (Slack) and you can use a system like OAuth to properly authenticate users. 大多数对话平台都可以登录(例如Google Assistant / Google上的“操作” ),或者您可以放心地假设用户使用的设备也可以访问网络浏览器(Slack),并且可以使用OAuth之类的系统正确验证用户身份。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM