我正在使用它,但这只会将其设置为空,
{
"context": {
"time": "",
"place": "",
"things": "",
"transport": ""
},
"output": {}
}
我也试过
"time": "null"
和 "time": "$time.remove"
最佳答案
对于在旧 API 版本上使用 Watson Assistant 的用户:
最好是用 context.remove()
in the output section .我通常有一个额外的子节点用于清理。
{
"output": {
"text": {},
"deleted": "<? context.remove('eventName') ?> <? context.remove('queryPredicate') ?>"
}
}
因为 deleted
不是上下文部分的一部分,它不会被结转。对于那些使用 Watson Assistant 的最新 API 版本的人:
将变量设置为空。这是 "Deleting a context variable" 上的文档.
{
"context": {
"myvariable": null
}
}
给变量赋值时,也可以在对话框中将变量设置为null。
关于ibm-cloud - 如何在 IBM Cloud 上移除 Watson Assistant 服务中的上下文变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48543487/