简体   繁体   English

如何在Watson Assistant中长时间停留?

[英]How to make a long pause in Watson Assistant?

I'm using IBM Watson Assistant for creating a chatbot. 我正在使用IBM Watson Assistant创建聊天机器人。 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). 我正在使用具有意图,实体和对话框流程的Web界面(我不知道它的名称,我只是将其称为Web界面)。

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. 我想在对话框中有一个节点,等待100秒,然后将另一条消息发送给用户,但前提是用户之间没有发送另一条消息。 I can add pause in a node but only a pause of at most 10s is possible. 我可以在节点中添加暂停,但是最多只能暂停10秒。 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? 我要如何解决这个问题,而要等100秒钟,并且如果用户在这100秒钟内没有发送消息,则仅在以后发送消息?

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. 如果与聊天机器人的对话时间超过10分钟,我想停止聊天并跳出分支机构。 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. 我可以通过存储对话开始时的当前时间,然后检查每个节点的时间差是否大于10分钟,如果大于10分钟,然后跳出来解决该问题。 But this is again not good style. 但这又不是好风格。 How can I solve this more elegant? 我该如何解决这个问题?

Unfortunately Watson Assistant does not provide this feature. 不幸的是,Watson Assistant不提供此功能。 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. 但是我们有很多方法可以做到这一点,因为Watson是一种API,例如,我们拥有创建自定义代码的所有后端。

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. 您可以使用上一个请求/message并创建一个setInterval ,如果传递的条件比上一个请求对/message传递要多,则可以添加一些条件,并发送所需的消息。

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

使用最新的Watson Assistant,您可以执行以下操作-{“ time”:5000,“ typing”:true,“ response_type”:“ pause”},

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM