我正在尝试将IBM Cloud Functions与Watson Assistant对话框作为web_action连接。因此,我在watson对话框json编辑器中指定了web_action,如下所示。
"actions": [
{
"name": "[email protected]_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' };
}
我的函数的URL是:
curl -u API-KEY -X POST https://us-south.functions.cloud.ibm.com/api/v1/namespaces/[email protected]_dev/actions/callKinvey?blocking=true
解决此类错误的最简单方法是将.json
附加到端点。