我正在使用它,但这只是将它设置为空,
{
"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
不是上下文部分的一部分,所以不会继续推进。
对于最新API版本的Watson Assistant:
将变量设置为null。这是关于"Deleting a context variable"的文档。
{
"context": {
"myvariable": null
}
}
您还可以添加子节点,并在条件设置为true的响应后将跳转添加到子节点,并将上下文变量设置为null。
我相信以下是你想要的。
{
"output": {
"text": {
"values": [
"Ok got it: $Var1, $Var2, $Var3. <? $Var1 = NULL ?> <? $Var2 = NULL ?> <? $Var3 = NULL ?>"
],
"selection_policy": "sequential"
}
}
}