无法在firebase云功能的帮助下获得用户的响应

时间:2018-06-08 07:38:03

标签: firebase google-cloud-functions actions-on-google dialogflow

我需要一个帮助,我没有在dialogflow firebase函数中获得用户的响应。请在index.js中找到编码       在TestIntent中,我想获得用户的响应(用户回答),我尝试使用“app.intent('Test Intent',(conv,input)”,并在“ask”中使用“$ {input}”。现在我尝试使用“app.intent('Test Intent',(conv,params)”,我没有得到用户的回复。请让我知道,如何获得用户的回复“

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);
//});

0 个答案:

没有答案