问题
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
回答1:
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
回答2:
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.
来源:https://stackoverflow.com/questions/50609370/conditionally-return-from-digression-in-watson-assistant