【问题标题】:How to retrieve specific profile variables from Watson's Dialog service via the watson-developer-cloud library如何通过 watson-developer-cloud 库从 Watson 的 Dialog 服务中检索特定的配置文件变量
【发布时间】:2016-01-20 21:52:19
【问题描述】:

Watson 的 Dialog 服务检索配置文件变量时,有一个名为 name 的参数允许您控制检索哪些变量。如果此参数为空,则返回与指定 client_id 关联的所有变量。否则,仅返回 name 中指定的变量。

我终于想出了如何在直接 GET 到 REST API 时指定多个变量名称(给它们都使用相同的名称,例如 &name=var1&name=var2),但我不知道如何通过沃森开发者云库。看来无论我在dialog.getProfile()函数调用中如何指定名称,它总是返回所有的变量。

谁能告诉我怎么做?我不想每次都获取它们,然后搜索它们以找到我想要的。

【问题讨论】:

标签: ibm-cloud ibm-watson watson-dialog


【解决方案1】:

库中有一个bug 阻止name 被发送到服务。

请通过以下方式更新库

npm install watson-developer-cloud

试试下面的例子

var params = {
  dialog_id: '<dialog id here>',
  client_id: '<client id here>',
  name: ['var1', 'var2']
};

dialog.getProfile(params, function(err, response){
  console.log(response)
});

【讨论】:

    猜你喜欢
    • 2019-09-01
    • 2016-11-10
    • 1970-01-01
    • 1970-01-01
    • 2016-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-07
    相关资源
    最近更新 更多