无法在firebase云函数的助手中获取用户的响应
我需要一个帮助,我在dialogflow firebase函数中没有得到用户的响应。请在index.js中找到编码 在测试内容中,我想获得用户的响应用户的答案,我尝试了app.intent'Test intent',conv,input,并在ask中使用了${input}。现在我尝试了app.intent'testintent',conv,params,我没有得到用户的响应。请让我知道,如何获得用户的响应无法在firebase云函数的助手中获取用户的响应,firebase,google-cloud-functions,actions-on-google,dialogflow-es,Firebase,Google Cloud Functions,Actions On Google,Dialogflow Es,我需要一个帮助,我在dialogflow firebase函数中没有得到用户的响应。请在index.js中找到编码 在测试内容中,我想获得用户的响应用户的答案,我尝试了app.intent'Test intent',conv,input,并在ask中使用了${input}。现在我尝试了app.intent'testintent',conv,params,我没有得到用户的响应。请让我知道,如何获得用户的响应 import * as functions from 'firebase-function
import * as functions from 'firebase-functions';
import * as gApp from 'actions-on-google';
import { myService } from './services/myService';
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
import admin from 'firebase-admin';
const app = gApp.dialogflow({debug: true});
process.env.DEBUG = 'dialogflow:debug';
//exports.dialogflowSample = functions.https.onRequest((request, response) =>
//{
app.intent('Default Welcome Intent',(conv) => {
conv.ask(`Welcome to my dialogFlow agent! <say-as >${input}</say-as>.</speak>`);
//conv.data.question = 'question1';
});
app.intent('Test Intent',(conv,params) => {
let qNo:string = conv.data.question;
conv.ask('<speak>Testing the application'
+`<say-as >`+conv.params.pain+`</say-as>.</speak>`);
conv.ask('<speak>Testing the application'+`<say-as >`+qNo+`</say-as>.</speak>`);
});
exports.dialogflowSample = functions.https.onRequest(app);
//});
如果您想准确返回用户所说的内容,可以执行以下操作:
app.intent('Test Intent',conv => {
let userRawInput = conv.input.raw;
conv.ask("You said exactly: "+userRawInput);
});
如果我使用google home进行测试,我会在conv.input.raw中得到相同的值吗,,你有没有参考conv中所有对象引用的指南,谷歌上的操作等等。我所做的是打印conv对象并检查其字段,然后找到我感兴趣的内容并使用它