简体   繁体   中英

IBM Watson Assistant - how to use input.text inside Slots

I am using IBM Watson Assistant for a chatbot. I have a dialog node with two slots. The first slot works fine. The node gets triggered and the bot asks for the first slot, since it is not present.

Then I would like to have the bot asking for the second slot. And the answer given should be stored in a $variable. I tried to achieve this with input.text , because I want to store every kind of input given there.

But instead of asking for the second slot the bot skips it and stores the answer given in slot one in the slot two $variable as well. I guess it's because the bot also checks if input.text is present in slot one. To make it clear, I have not activated the 'prompt for everything' option.

How can I overcome this?

I am sure these screenshots of my test environment will make everything more clear:

This is because input.text as a check matches all input, so no matter what you enter your second slot will always be satisfied.

The way slots work is that it doesn't matter in which order the information is given or how much is given.

For Example: Say I have an ordering system looking for 'product', 'quantity', and 'delivery date'

The request 'I want spoons for the 3rd Feb'

Then two of the slots 'product' and 'delivery date' are satisfied and the output response will be for the prompt for the missing 'quantity' slot.

In your case you need to determine what information you are trying to gather. Is there an entity or an intent that is going to uniquely match the input. If so then you could use a slot. As a brute force match you can make the condition for the second slot more complex.

For example when looking for confirmation of an order you can add in the condition, which only triggers when all above slots have been completed, and you are looking to confirm whether you collected the instructions correctly.

(#yes || #no) && slot_in_focus

If this kind of approach doesn't fit your application then you should gather this information after the node for the slots.

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