Search code examples
node.jswatson-conversationwatson

Watson conversation always start from the root


I'm working on a project with node.js, and i'm using the watson conversation service of IBM. The problem is when i send text for a right node it always start from the root node and ignore the right nodes.

I use the code presented in the documentation:

var watson = require('watson-developer-cloud');
var conversation = watson.conversation({
  username: '{username}',
  password: '{password}',
  version: 'v1',
  version_date: '2016-09-20'
});
conversation.message({
  workspace_id: '25dfa8a0-0263-471b-8980-317e68c30488',
  input: {'text': 'Turn on the lights'},
  context: context
},  function(err, response) {
  if (err)
    console.log('error:', err);
  else
    console.log(JSON.stringify(response, null, 2));
});

thank you for helping.


Solution

  • Thanks to @SimonO'Doherty, it finaly worked, and it is simple. Just return back the context of the old output.