gpt4 book ai didi

ibm-cloud - 如何删除 IBM Cloud 上的 Watson Assistant 服务中的上下文变量

转载 作者:太空宇宙 更新时间:2023-11-04 01:26:11 25 4
gpt4 key购买 nike

我正在使用这个,但这只会将其设置为空,

{
"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 版本的用户:

将变量设置为 null。这是关于 "Deleting a context variable" 的文档.

{
"context": {
"myvariable": null
}
}

给变量赋值时,也可以在对话框中将变量设置为 null。

关于ibm-cloud - 如何删除 IBM Cloud 上的 Watson Assistant 服务中的上下文变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57440658/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com