![](/img/trans.png)
[英]How to get context variables from the response of IBM watson assistant V2 using Nodejs?
[英]how to add update multiple response of a dialog node in IBM watson assistant with Nodejs
我有一個正在與IBM Watson Assistant交互的節點應用程序。 我需要更新對話框節點的響應輸出,並且正在使用以下watson api
var params = {
workspace_id: //,
dialog_node: 'greeting',
new_dialog_node: 'greeting',
new_output: {
text: 'Hello! What can I do for you?'
//add more than one text
}
};
assistant.updateDialogNode(params, function(err, response) {
if (err) {
console.error(err);
} else {
console.log(JSON.stringify(response, null, 2));
}
});
該API僅接受對象類型text:'Hello! What can I do for you?'
text:'Hello! What can I do for you?'
這也會覆蓋之前的響應
錯誤[ { message: 'output should be of type Object', path: '.output' } ]
如何更新對話框並同時添加多個響應或更新現有的? 提前致謝!
您是否對new_output嘗試了以下格式?
{ "text": { "values": [ "first response", "second response" ], "selection_policy": "sequential" }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.