Search code examples
ibm-cloudchatbotibm-watsonwatson-conversation

IBM Watson Assistant - store slot data in custom defined entitiy?


I am using slots in one of my nodes in the dialog of IBM Watson Assistant. The issue is none of system provided entities for slots(sys-person, sys-percentage, sys-number...) does not fit my need.

I need a company name to be saved. So I created my own entity named @companyName added pattern, and when the user enters value it is recognized by the entity pattern but the data is not saved to the entity.

How can I save the answer the user gives to that question in the my entity @companyName

screenshots:

entity definition

enter image description here

conversation with the bot

---


Solution

  • I figured it out!

    Everything that I had to do is append .literal in the second screenshot after the Check for: @companyName.

    So now the slots part looks like this, and we have the entered value inside the variable $companyName

    enter image description here

    I found it in the official documentation, more precisely here: https://cloud.ibm.com/docs/services/assistant/dialog-slots.html#dialog-slots

    (under number 4. Add a slot for each unit of required information. For each slot, specify these details)