Google Place Helper忽略了"是"响应

时间:2018-06-03 09:04:28

标签: node.js helper dialogflow

我试图在我的WebhookClient中使用Place帮助器,但它无法从Google获取我的位置,并且当我说" yes"时似乎忽略了我。请求"我可以从谷歌获得吗?"。

代码

const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');

// Standard path doesn't seem to work at all, explicit path half works...
//const {Place} = require('actions-on-google');
const {Place} = require('dialogflow-fulfillment/node_modules/actions-on-google');

...

function askForPlace (agent) {
    let conv = agent.conv();

    const options = {
        context: getTranslatedString(agent.locale, "LOCATION_CONTEXT"),
        prompt: getTranslatedString(agent.locale, "LOCATION_PROMPT"),
    };
    conv.ask(new Place(options));

    agent.add(conv);
}

我承认这是一个kludge,因为我没有使用Place的文档化路径,但是如果我使用已记录的路径,那么它就不会启动帮助。

我做错了什么?这是使用Alpha代码的结果吗?

如果这不起作用,获取用户位置的正确方法是什么(lat / long会做什么)?我也尝试过Permission来获取用户的位置,但是也存在类似的问题。

谢谢!

0 个答案:

没有答案