相同意图的不同输出

Different Outputs for the same intent

在服务器上部署时以及在 Watson 对话中进行测试时,我得到了相同意图 #what-time 的不同 @sys-time 输出。我哪里错了? context 变量设置为我的国家 timezone:Asia/calcutta。我附上了图片!

几周前我遇到了同样的问题。而且,您在 IBM Bluemix 中看到,Watson Conversation Service 设置了 context 变量 timezone。 也就是说,您应该对代码执行相同的操作。

在您的应用程序中,将上下文变量时区设置为您所在的区域。喜欢:

data.context.timezone = "America/Sao_Paulo"

观察:Data 是来自 Watson Conversation Service 的 return(意图、实体、上下文变量等)

此示例使用的是 Nodejs,但您可以尝试使用任何编程语言。

检查 (timezone 在对话服务中设置):

检查 timezone 在我的应用程序中使用代码设置):

编辑(你在哪里添加这段代码?)

//add inside your call, like:
conversation.message(payload, function (err, data) {
    data.context.timezone = "America/Sao_Paulo";
    if (err) {
      return res.status(err.code || 500).json(err);
    }
    updateMessage(payload, data, req, res);

  });
});