1
votes

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.

1
You need to pass back in the context object that is returned. So that it knows where you left off.Simon O'Doherty
@SimonO'Doherty can you please send me an example Json of the context. thank you.Ahmed Commando
Context object comes back in your first response. The simple demo should show you. github.com/watson-developer-cloud/conversation-simpleSimon O'Doherty
@SimonO'Doherty thank you.Ahmed Commando

1 Answers

1
votes

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