Dialogflow es 谷歌的行动-位置许可

Dialogflow es 谷歌的行动-位置许可,dialogflow-es,actions-on-google,Dialogflow Es,Actions On Google,如何使用webhook请求设备位置,以及google v2上的操作 以前,我使用了permission_request字段,但现在已经不推荐使用了,并且不确定它在何处适合位于的响应对象 json响应 { speech: "", displayText: "", data: { google: { expectUserResponse: true, noInputPrompts: [ { textToSpeech: "Hello McFly!" }, { textToSpeech: "Good t

如何使用webhook请求设备位置,以及google v2上的操作

以前,我使用了permission_request字段,但现在已经不推荐使用了,并且不确定它在何处适合位于的响应对象

json响应

{
speech: "",
displayText: "",
data: {
google: {
expectUserResponse: true,
noInputPrompts: [
{
textToSpeech: "Hello McFly!"
},
{
textToSpeech: "Good talk, Russ"
},
{
textToSpeech: "Alright, I'm just gonna go over here and hang out. Let me know if there is anything else I can do for you."
}
],
richResponse: {
items: [
{
simpleResponse: {
textToSpeech: "Testing",
ssml: "<speak >Testing</speak>",
displayText: "Testing"
},
basicCard: null
}
],
suggestions: [ ],
linkOutSuggestion: {
destinationName: null,
url: null
}
},
systemIntent: null,
possibleIntents: [
{
intent: "actions.intent.PERMISSION",
inputValueData: {
@type: "type.googleapis.com/google.actions.v2.PermissionValueSpec",
optContext: "To provide weather information for you.",
permissions: [
"DEVICE_COARSE_LOCATION"
]
}
}
]
}
},
contextOut: [ ],
source: "Abbi"
}
{
致辞全文:,
显示文本:“”,
数据:{
谷歌:{
expectUserResponse:对,
无输入提示:[
{
textToSpeech:“你好,麦克弗利!”
},
{
textToSpeech:“说得好,罗斯”
},
{
textToSpeech:“好吧,我就到这里来闲逛。如果还有什么我能为你做的,请告诉我。”
}
],
答复:{
项目:[
{
简单响应:{
textToSpeech:“测试”,
ssml:“测试”,
显示文本:“测试”
},
基本卡片:空
}
],
建议:[],
链接建议:{
destinationName:null,
url:null
}
},
systemIntent:null,
可能的内容:[
{
意图:“动作。意图。权限”,
inputValueData:{
@类型:“type.googleapis.com/google.actions.v2.PermissionValueSpec”,
optContext:“为您提供天气信息。”,
权限:[
“设备\u粗略\u位置”
]
}
}
]
}
},
上下文输出:[],
资料来源:“Abbi”
}

因此我需要将权限请求添加为系统意图、非预期意图或可能意图

下面的json现在可以工作了

{
speech: "",
displayText: "",
data: {
google: {
expectUserResponse: true,
noInputPrompts: [
{
textToSpeech: "Hello McFly!"
},
{
textToSpeech: "Good talk, Russ"
},
{
textToSpeech: "Alright, I'm just gonna go over here and hang out. Let me know if there is anything else I can do for you."
}
],
richResponse: {
items: [
{
simpleResponse: {
textToSpeech: "",
ssml: "<speak ></speak>",
displayText: ""
},
basicCard: null
}
],
suggestions: [ ],
linkOutSuggestion: {
destinationName: null,
url: null
}
},
systemIntent: {
intent: "actions.intent.PERMISSION",
data: {
@type: "type.googleapis.com/google.actions.v2.PermissionValueSpec",
optContext: "To provide an accurate experience, ",
permissions: [
"DEVICE_PRECISE_LOCATION"
],
carouselSelect: null
}
}
}
},
contextOut: [ ],
source: "Abbi"
}
{
致辞全文:,
显示文本:“”,
数据:{
谷歌:{
expectUserResponse:对,
无输入提示:[
{
textToSpeech:“你好,麦克弗利!”
},
{
textToSpeech:“说得好,罗斯”
},
{
textToSpeech:“好吧,我就到这里来闲逛。如果还有什么我能为你做的,请告诉我。”
}
],
答复:{
项目:[
{
简单响应:{
textToSpeech:“”,
ssml:“”,
显示文本:“
},
基本卡片:空
}
],
建议:[],
链接建议:{
destinationName:null,
url:null
}
},
系统意图:{
意图:“动作。意图。权限”,
数据:{
@类型:“type.googleapis.com/google.actions.v2.PermissionValueSpec”,
optContext:“提供准确的体验,”,
权限:[
“设备的精确位置”
],
转盘选择:空
}
}
}
},
上下文输出:[],
资料来源:“Abbi”
}

你看过用户信息助手了吗:我使用的是c#webhook,所以我的对象有点不同。可以找到从我的webhook生成的json包的示例,我很难确定“可能内容”对象属于哪个级别。如果你是指ExpectedIntent,那么这就是文档:在上一个示例的json中,是的,这似乎是需要填充的对象。但是,在webhook中使用v2时,在该级别创建expectedInput对象不起作用。在所提供的gist链接示例中,这些卡片起作用。您是说我没有创建ExpectedInput对象,而是将用户位置权限请求作为systemIntent放入?该文档似乎也适用于版本1,因为它不是camelCase,而v2应该是。