我试图在此处实现实现以获取用户数据,但是使用初始Web钩子实现进行测试,以检查是否实现了实现。但是当我以欢迎的意图进行测试时,它会抛出请求超时。 我想知道为什么我会收到此错误?如何解决此错误
'use strict';
const {dialogflow} = require('actions-on-google');
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
const agent = new WebhookClient({ request, response });
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
console.log('Dialogflow Request body: ' + JSON.stringify(request.body));
const app = dialogflow({debug: true});
app.intent('Default Welcome Intent', (conv) => {
conv.ask('Welcome to action snippets! Say a number.');
});
//function welcome(agent) {
// agent.ask(`hii, how can i help you?`);
//}
function fallback(agent) {
agent.add(`I didn't understand`);
agent.add(`I'm sorry, can you try again?`);
}
当我通过正常的函数调用实现app.intent时:
功能欢迎(代理)...... 它成功运行
预期输出应为:
嗨,我能为您提供什么帮助?