Monday, 24 April 2017

timeout for chatbot Watson Conversation Service

Currently I'm Development some chatbots, and I want to know how finish the conversation with something like timeout.

Example I:

if(callback.error){
data.output.text = "The server is offline now. Please try again later. Goodbye!";
return res.json(data); //send the message
System.exit(); //example
}

Example II:

if(userInputText == false && data.context.time === 120){
//time = seconds
data.output.text = "Sorry $name, you late for answer my question and Unfortunally you have to try again for make some request. Thanks advance and have a nice day!";
return res.json(data); //send the message
System.exit(); //example
}

And the conversation will finish after the message will send to the user. But I need to get some way to make sure if user does not type anything. And I want save this with boolean value true or false inside userInputText variable.

Base: conversation-simple.

How to solved this?

Thanks advance.



via Sayuri Mizuguchi

No comments:

Post a Comment