Search code examples
ibm-watsonwatson-conversation

How to make a long pause in Watson Assistant?


I'm using IBM Watson Assistant for creating a chatbot. I'm using the web interface with the intents, entities and dialog flow|tree (I don't know how it is called, I'm just calling it web interface).

I would like to have one node in the dialog which waits for say 100s and then sends another message to the user but only if the user did not send another message in-between. I can add pause in a node but only a pause of at most 10s is possible. Of course I could add multiple such pause in sequence in a node but that's not so good style. How can I solve this instead to wait 100s and only sending a message afterwards if the user did not send a message during this 100s?

Moreover, I have a pretty linear flow in my chatbot (one large branch in the dialog tree). If the conversation with the chatbot is longer than 10 minutes I would like to stop it and jump out of the branch. I could solve it by storing the current time when the conversation starts and then checking in each node if the time difference is larger than 10 minutes and if so, jumping out. But this is again not good style. How can I solve this more elegant?


Solution

  • Unfortunately Watson Assistant does not provide this feature. But we have a lot of ways to do that, cause Watson is one API and we have all the back-end to create custom code, for instance.

    You can use the last request /message and create one setInterval, adding some condition if passed more than since the last request to /message as you would like to and send some message that you want.

    if(inputTiming > 100000) { 
      response.output.text = 'Hey, are you there?';
      return response
    }