0

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?

machinery
  • 5,972
  • 12
  • 67
  • 118

2 Answers2

1

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
}
Sayuri Mizuguchi
  • 5,250
  • 3
  • 26
  • 53
  • I will directly embedd my chatbot into facebook messenger without a middleware. How can I incorporate your approach into a dialog node in Watson Assistant? I don't know how to use javascript there. – machinery Jan 03 '19 at 01:25
  • For sure you can do that. You can integrate multiples API! You will do something like [that](https://medium.com/@Xourse/how-to-connect-your-watson-chatbot-with-facebook-messenger-db32f1a53a05) and in your Node backend you gonna use the example that I made. One question that I answered and you can follow [here](https://stackoverflow.com/questions/47152239/how-to-integrate-facebook-with-watson-conversation/47162262#47162262) and the official tutorial [here](https://developer.ibm.com/recipes/tutorials/how-to-create-a-chatbot-in-facebook-messenger/) – Sayuri Mizuguchi Jan 03 '19 at 02:34
  • Obs.: You can use ANY language that can do http requests in your backend. But I do suggest use the [Watson Developer Cloud](https://github.com/watson-developer-cloud) with a lot of **official** examples for Watson Services. – Sayuri Mizuguchi Jan 03 '19 at 02:35
  • Thank you Sayuri. Perhaps I will use Skype instead of Facebook Messenger. But I think for Skype I can just follow this tutorial: https://developer.ibm.com/recipes/tutorials/how-to-build-a-chatbot-with-watson-conversation-using-microsoft-botframework/. Is this correct? – machinery Jan 03 '19 at 15:55
  • Moreover, I would prefer Java or Python over Javascript but I think with Node.js only javascript is possible and I did not find the same tutorial you have linked for Java or Python. But in the end, Javascript should also be fine because I will not use it much. – machinery Jan 03 '19 at 15:57
  • So, I think I'm able to connect my bot to Messenger or Skype (following [this](https://developer.ibm.com/recipes/tutorials/how-to-create-a-chatbot-in-facebook-messenger/) or [this](https://developer.ibm.com/recipes/tutorials/how-to-build-a-chatbot-with-watson-conversation-using-microsoft-botframework/)). But after having done that I'm stuck. Could you please explain step by step what I have to do in the dialog node and perhaps in app.js? – machinery Jan 03 '19 at 16:07
  • I have two goals: 1) Waiting in one node for 100s and then sending a message IF the user did not write another message meanwhile. 2) Checking (at every node) if the conversation duration is longer than 10 minutes and if so jump to a specific dialog node (jumping out of the dialog tree). I would be very very very happy if you could show me this step by step. – machinery Jan 03 '19 at 16:08
  • Yeah you can do all of that, with any language that you choose. Its up to you! I'm just showing one example that you can have some idea about what to do. – Sayuri Mizuguchi Jan 03 '19 at 23:02
  • You must contract someone to do that, if you not familiar with javascript and Node.js. It can take some time to do and I won't able to put everything here cause is a lot. But you need to use the instance of Watson Conversation and the response argument to send a message back, native Javascript functions for timing and conditions in javascript. – Sayuri Mizuguchi Jan 03 '19 at 23:14
0

With Latest Watson Assistant, you can do something like this - { "time": 5000, "typing": true, "response_type": "pause" },