Conditionally return from digression in watson assistant

639 Views Asked by At

I have been reading through the documentation and cannot find the answer to this question for Watson Assistant.

I have a digression that I only sometimes want to return back to the previous place in the dialog.

Specifically, after the user enters the digression, if the user responds "Yes" then I do not want the digression to return back, but if the user responds "No" then I do want the digression to return to the previous place.

Is there a way to do this? Perhaps by manually editing the JSON to somehow override the directive to return from the digression in some cases?

Below is a diagram of the issue:

Dialog Flow

2

There are 2 best solutions below

1
akaykay On

If I understand you correctly, you could create two different nodes for handling the user response of "yes" or "no" based on the way digressions are setup today. If yes, the node needs to be configured to not return back (don't click the checkbox). If no, click the checkbox.

enter image description here

1
Michal Bida On

There is a function <? clearDialogStack() ?> that when called it will erase all the digressions that are set in dialog and hence the dialog will not return from digression. So just call this function in a node where you don't want WA to return.

Here it is in the doc: https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-runtime#dialog-runtime-digressions