尝试在 Dialogflow 中获取用户的当前位置时遇到错误
Facing error while trying to fetch user's current location in Dialogflow
我需要在 dialogflow 中获取用户的当前位置。为此,我创建了一个意图 - UseMyLocation,然后是后续意图并在其中添加了事件 GOOGLE_ASSISTANT PERMISSION
function requestPermission(agent) {
agent.requestSource = agent.ACTIONS_ON_GOOGLE;
let conv = agent.conv();
console.log('conv '+conv);
conv.ask(new Permission({
context: 'to locate you',
permissions: 'DEVICE_PRECISE_LOCATION',
}));
}
intentMap.set('movie.book.ticket - UseMyLocation',requestPermission);
agent.handleRequest(intentMap);
It should ask for user's permission for the location instead it is throwing exception:
Error: No responses defined for platform: ACTIONS_ON_GOOGLE
at V2Agent.sendResponses_ (/srv/node_modules/dialogflow-fulfillment/src/v2-agent.js:243:13)
at WebhookClient.send_ (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:505:17)
at promise.then (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:316:38)
at <anonymous>
package.json
"dependencies": {
"actions-on-google": "^2.2.0",
"firebase-admin": "^5.13.1",
"firebase-functions": "^2.0.2",
"dialogflow": "^0.6.0",
"dialogflow-fulfillment": "^0.6.0"
}
请帮忙
请尝试以下您缺少的解决方案 agent.add(conv);
function requestPermission(agent)
{
agent.requestSource = agent.ACTIONS_ON_GOOGLE;
let conv = agent.conv();
console.log('conv '+conv);
conv.ask(new Permission({
context: 'to locate you',
permissions: 'DEVICE_PRECISE_LOCATION',
}));
agent.add(conv); // Please add this
}
我需要在 dialogflow 中获取用户的当前位置。为此,我创建了一个意图 - UseMyLocation,然后是后续意图并在其中添加了事件 GOOGLE_ASSISTANT PERMISSION
function requestPermission(agent) {
agent.requestSource = agent.ACTIONS_ON_GOOGLE;
let conv = agent.conv();
console.log('conv '+conv);
conv.ask(new Permission({
context: 'to locate you',
permissions: 'DEVICE_PRECISE_LOCATION',
}));
}
intentMap.set('movie.book.ticket - UseMyLocation',requestPermission);
agent.handleRequest(intentMap);
It should ask for user's permission for the location instead it is throwing exception:
Error: No responses defined for platform: ACTIONS_ON_GOOGLE
at V2Agent.sendResponses_ (/srv/node_modules/dialogflow-fulfillment/src/v2-agent.js:243:13)
at WebhookClient.send_ (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:505:17)
at promise.then (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:316:38)
at <anonymous>
package.json
"dependencies": {
"actions-on-google": "^2.2.0",
"firebase-admin": "^5.13.1",
"firebase-functions": "^2.0.2",
"dialogflow": "^0.6.0",
"dialogflow-fulfillment": "^0.6.0"
}
请帮忙
请尝试以下您缺少的解决方案 agent.add(conv);
function requestPermission(agent)
{
agent.requestSource = agent.ACTIONS_ON_GOOGLE;
let conv = agent.conv();
console.log('conv '+conv);
conv.ask(new Permission({
context: 'to locate you',
permissions: 'DEVICE_PRECISE_LOCATION',
}));
agent.add(conv); // Please add this
}