const agent = new WebhookClient({request, response});
const {WebhookClient} = require('dialogflow-fulfillment');
const {Text, Card, Image, Suggestion, Payload} = require('dialogflow-fulfillment');
let payload = {
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"optContext": "To deliver your order",
"permissions": [
"NAME",
"DEVICE_PRECISE_LOCATION"
]
}
}
};
agent.add('PLACEHOLDER_FOR_PERMISSION');
agent.add(new Payload(PLATFORMS.ACTIONS_ON_GOOGLE, payload));
使用允许意图获取UserLocation和Name的简单有效负载
对上面的反应我明白了
要发送您的订单,我需要获取您的姓名和街道地址 来自Google。那可以吗?
此意图的跟随意图也设置为事件 actions_intent_PERMISSION
我一直试图通过尝试使用建议芯片等解雇 actions_intent_PERMISSION 来解决这个问题,但此后没有任何反应?
我哪里出错了,我无法理解。在某个地方有一些愚蠢的错误 - 如果有人可以指出它 - 请帮助很多。
由于
===========编辑============为这些意图附着的图像============
permissions response with event actions_intent_PERMISSION
编辑:由于点数无法嵌入图像。以上链接在那里。感谢
================================= request-response json ========== ========= 当下面触发意图权限时,请求
{
"responseId": "54a4be35-3d0b-4cc8-b036-46fab0d09361",
"queryResult": {
"queryText": "permissions",
"action": "permissions",
"parameters": {},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [
{
"text": {
"text": [
""
]
}
}
],
"intent": {
"name": "projects/projectid/agent/intents/95237653-0af0-4d0c-9101-0cd8ee0db186",
"displayName": "permissions"
},
"intentDetectionConfidence": 1,
"diagnosticInfo": {},
"languageCode": "en"
},
"originalDetectIntentRequest": {
"payload": {}
},
"session": "projects/projectid/agent/sessions/13213e7f-dba5-4d0c-979a-f626f7ac4691"
}
履行回应
{
"conversationToken": "[]",
"expectUserResponse": true,
"expectedInputs": [
{
"inputPrompt": {},
"possibleIntents": [
{
"intent": "actions.intent.PERMISSION",
"inputValueData": {
"@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"permissions": [
"NAME",
"DEVICE_PRECISE_LOCATION"
],
"optContext": "To locate you"
}
}
],
"speechBiasingHints": [
"$name-type",
"$sports",
"$gender"
]
}
],
"responseMetadata": {
"status": {
"message": "Success (200)"
},
"queryMatchInfo": {
"queryMatched": true,
"intent": "95237653-0af0-4d0c-9101-0cd8ee0db186"
}
}
}
模拟器对权限意图
的响应=============================================== ========================
问题已经解决 注意事项: