简体   繁体   中英

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

<? 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."

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). Check this article for more information on detecting names and locations with IBM Watson Assistant

  • On the welcome node, click Customize and enable Slots . This adds a new section to your node.
  • Under check for , enter the entity @name. Save the response in a context variable ($name).
  • If there's no name in the response, prompt for a question 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

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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