gpt4 book ai didi

javascript - Actions Sdk 收到此错误 TypeError : Cannot read property 'output' of undefined

转载 作者:行者123 更新时间:2023-11-30 20:03:59 25 4
gpt4 key购买 nike

我正在尝试连接 IBM Watson 和 Google Assistant,但我不断收到此错误“TypeError:无法读取未定义的属性‘输出’”和此“函数执行耗时 3323 毫秒,完成状态:‘崩溃’”

这是我的代码:

const {actionssdk} = require('actions-on-google');
const functions = require('firebase-functions');

const app = actionssdk({debug: true});

app.intent('actions.intent.MAIN', (conv) => {
conv.ask('Olá, como posso lhe ajudar?');
});


app.intent('actions.intent.TEXT', (conv, input) => {
var AssistantV1 = require('watson-developer-cloud/assistant/v1');
var assistant = new AssistantV1({
username: '###################################',
password: '###################################',
url: '###################################',
version: '2018-07-10'
});
conv.ask("eeeeeeeeeeeeeeeee");
return new Promise( (resolve, reject) => {
assistant.message(
{
workspace_id: '###################################',
input: { text: input },
headers: {'Content-Type':'application/json'}
},
function(err, response) {
conv.ask(response.output.text[0]);
resolve();
}
);
})
});
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);

最佳答案

丽贝卡,只是为了添加信息,您正在尝试添加一些出站访问权限,但您需要配置您的帐户才能执行此操作。

"Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions"

如果您想调用某些 API(IBM Watson,已验证),您需要启用计费。

对于其他配额,take a look here to see prices - 如您所见,使用免费套餐的调用次数有限制。

关于javascript - Actions Sdk 收到此错误 TypeError : Cannot read property 'output' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53102514/

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