ibm-cloud - IBM Watson Assistant:如何解决 web_action 错误“内部错误:无法检索内容类型。”
问题描述
我正在尝试将 IBM Cloud Functions 与 Watson Assistant 对话框连接为 web_action。所以我在 watson 对话框 json 编辑器中指定了 web_action 如下。
"actions": [
{
"name": "rajesh@heltha.co_dev/default/callKinvey",
"type": "web_action",
"parameters": {
},
"credentials": "$private.mycredential",
"result_variable": "context.my_input_returned"
}
]
现在,问题是在测试助手时出现以下错误
内部错误:无法检索内容类型。(并且日志中还有 1 个错误)
以下是我在 IBM-cloud 上创建并为Web Action启用的函数:
/**
*
* main() will be run when you invoke this action
*
* @param Cloud Functions actions accept a single parameter, which must be a JSON object.
*
* @return The output of this action, which must be a JSON object.
*
*/
function main(params) {
return { message: 'Hello World' };
}
我的函数的 CURL 是:
curl -u API-KEY -X POST https://us-south.functions.cloud.ibm.com/api/v1/namespaces/rajesh@heltha.co_dev/actions/callKinvey?blocking=true
解决方案
解决此类错误的最简单方法是附加.json
到您的端点。
推荐阅读
- apache-flink - Apache Flink:以键为标签的指标
- java - 异常 PersistenceException 推翻 NoSuchException
- aws-sdk - MuleSoft AWS SDK -- 跨账户信任 (assumeRole)
- javascript - 数组比较函数返回两个数组
- deep-learning - 如何微调 BERT 模型?
- ios - 从键盘获取在 wkwebview 上输入的文本
- wordpress - Wordpress 网站已停止加载,WP Admin 未加载
- javascript - 使用 Nuxt 点击时调用 api
- r - 如何在 RMarkdown 内联代码中编写正确的表达式
- heatmaply - 热图不显示情节