简体   繁体   English

IBM Watson Assistant:如何允许从具有非条件子节点的对话节点离题?

[英]IBM Watson Assistant: How to allow digressions from dialog node with a non-conditional child node?

I have created a chatbot based to answer some geometry questions on my site.我创建了一个聊天机器人来回答我网站上的一些几何问题。 Using the example in the IBM course on how to make it user-friendly, I have a welcome node ask for the user's name, which is then read in a child node which is always true ("If assistant recognizes:" true) using使用 IBM 课程中关于如何使其对用户友好的示例,我有一个欢迎节点询问用户名,然后在子节点中读取该用户名,该子节点始终为真(“如果助手识别:”真)使用

<? input.text.substring(0, 1).toUpperCase() + input.text.substring(1)?>

I then saw that most users ignore the question in the welcome node that asks for their name, and jump straight into asking a question.然后我看到大多数用户忽略了欢迎节点中询问他们姓名的问题,并直接跳入提问。 I want to enable a digression to the node that answers the question, but in the dialog builder, the parent node won't allow digressions because我想为回答问题的节点启用题外话,但在对话生成器中,父节点不允许题外话,因为

"This node's children block digressions away - A child of this node conditions on anything_else or true, so it will always trigger before digression occurs." “此节点的子节点阻止离题 - 此节点的子节点条件为 any_else 或 true,因此它始终会在离题发生之前触发。”

And in the child node, digressions are not enabled because在子节点中,没有启用离题,因为

"This node has no children Digressions are not possible if a node has no children as the flow has already ended." “这个节点没有子节点如果一个节点没有子节点,因为流程已经结束,所以不可能离题。”

Any way around this?有什么办法吗?

If you are asking for the name of the user, slots are the best option.如果您要询问用户的姓名,插槽是最佳选择。 Here's how you can prompt the user for their name if not provided如果未提供,以下是提示用户输入姓名的方法

Before using Slots, I would recommend you to create an entity (@name) and an optional intent (#ask-for-name).在使用 Slots 之前,我建议您创建一个实体 (@name) 和一个可选意图 (#ask-for-name)。 Check this article for more information on detecting names and locations with IBM Watson Assistant查看本文以获取有关使用 IBM Watson Assistant 检测名称和位置的更多信息

  • On the welcome node, click Customize and enable Slots .在欢迎节点上,单击Customize并启用Slots This adds a new section to your node.这会向您的节点添加一个新部分。
  • Under check for , enter the entity @name.check for ,输入实体@name。 Save the response in a context variable ($name).将响应保存在上下文变量 ($name) 中。
  • If there's no name in the response, prompt for a question Please provide your name before asking a Geometry Q如果回复中没有姓名,则提示问题Please provide your name before asking a Geometry Q 在此处输入图像描述

Now, when you Try it.现在,当您尝试时。 Here's what you see and also when you click Manage Context , you can see the name in the response is assigned to $name and now you can use $name in any other node to address the person这是您看到的内容,当您单击Manage Context时,您可以看到响应中的名称已分配给$name ,现在您可以在任何其他节点中使用 $name 来解决此人的问题

在此处输入图像描述

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

相关问题 Watson Assistant对话框-无法进入子节点 - Watson Assistant Dialog - unable to enter into child node 如何从URL触发IBM Watson Assistant中的特定节点 - How to trigger a specific node in IBM Watson Assistant from URL IBM Watson Assistant:使用数组的对话节点条件表达式? - IBM Watson Assistant: Expressions on dialog node condition using array? 如何使用Node.js在IBM Watson Assistant中添加对话框节点的更新多个响应 - how to add update multiple response of a dialog node in IBM watson assistant with Nodejs IBM Watson Assistant:如何从对话框进行API调用 - IBM Watson Assistant: How to make API calls from dialog 对话节点内的 IBM Watson Assistant 搜索技能始终返回 3 个结果 - IBM Watson Assistant search skill inside a dialog node always returns 3 results 协调Kubernetes上的节点Red副本访问IBM Watson Assistant时出现问题 - Problem coordinating Node Red replicas on Kubernetes accessing IBM Watson Assistant IBM Watson Assistant:带链接的节点中的“试用”和Messenger中的区别 - IBM Watson Assistant: Difference between “Try out” and Messenger in node with link 如何使IBM Watson Assistant欢迎节点启动与Node.js或Python的对话? - How to make IBM Watson Assistant welcome node starts the conversation with Node.js or Python? IBM Watson Assistant:chatbot调用本地节点功能 - IBM Watson Assistant: chatbot calling local node functions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM