[英]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 检测名称和位置的更多信息
Customize
and enable Slots
.Customize
并启用Slots
。 This adds a new section to your node.check for
, enter the entity @name.check for
,输入实体@name。 Save the response in a context variable ($name).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.