0

So to my understanding, entities are supposed to be re-used amongst different slots to optimize for the fact that you may want to accept a user input info for similar data types i.e. two separate slots "what is your household income", "what is your spouse's household income" would both use the @sys-currency entity.

In my current dialog flow, I have two child nodes each with one slot that checks for the sys-currency entity type. I'm using two different context variables however to set the slot.

The problem is that after the user inputs an answer for the first child node ('household income'), the context variable is then set for the following one as well. They have the same entity, but different context variables. To my understanding, this shouldn't be happening. I can confirm the node is processed, but it immediately skips the prompt as if it's already been filled and delivers the response in the node.

First node Second node

Elmir Kouliev
  • 77
  • 1
  • 12

3 Answers3

0

You are telling it to jump to the next slot and look for that entity. The user does not get the chance to input anything because their last message contained that entity. You should try jump to and wait for user input

Mitch
  • 849
  • 4
  • 4
0

If one node is giving a jump-to to the other, this will happen. The reason is because the intent and the entities found on the user input will be evaluated against all nodes from the flow until a new "wait for user input", where they will be changed.

In those situations, i normally create a new entity with a value that would never be found (like 389jd8239d892d8h89hf32hdsa8hdj3), to force every input into the not-found node of the slot, and there i use the entity necessary, in this case it would be the @sys-currency. This way the question will aways show, even if in a previous input the user typed a valid currency. To me it's useful when dealing with flows that use a lot of @sys-numbers/@sys-currency/@sys-date, and there isen't a lot of text to use to differenciate the values.

Another option would be to remove the slot and use a single node, with his own flow to get the answer. Personally i prefer to use slots, since it's easy to treat multiple possibilities. I would even put both questions on the same node, just using conditions to check if the slot should be evaluated or not.

I have searched for a way to clear the intent/entity recognized from the input in a previous node, but at no success.

Felipe Paixao
  • 411
  • 3
  • 7
0

So... I know this is a year and 3 months late, but I'll provide an answer in case anyone else is experiencing this issue.

The root cause is the "Divorce - Household Income" node sets the input.text to a value that the @sys-currency entity matches so any nodes you jump to that matches based on @sys-currency will automatically have their context variables set to the input.text without prompting the user.

Unfortunately, I haven't seen any documentation from IBM that allows you to set the input.text to null.

To solve this issue, you need the user to provide some other value that won't match @sys-currency.

Thankfully, the solution is simple to implement and users may actually prefer you follow my outline below.

Simply have your "Divorce - Household Income" node jump to a node that asks them to confirm their entry. Options such as Yes and No are perfect since they'll set input.text to "Yes" or "No", respectively.

Finally, jump to the "Divorce - Spouse Income" node. Since @sys-currency won't match the user's input.text, the node will properly prompt the user to fill the $spouse_annual_income slot.

Andrew Davis
  • 21
  • 1
  • 2