Actions on google Gactions项目正在发送版本1请求架构
根据这份文件 Google现在使用的是版本2的JSON模式,但我的服务器从模拟器接收到的请求是版本1。要获得版本2 JSON模式,我需要做些什么吗 我已将我的gactions project action.json文件更新为新格式并上传 这是我的Actions on google Gactions项目正在发送版本1请求架构,actions-on-google,Actions On Google,根据这份文件 Google现在使用的是版本2的JSON模式,但我的服务器从模拟器接收到的请求是版本1。要获得版本2 JSON模式,我需要做些什么吗 我已将我的gactions project action.json文件更新为新格式并上传 这是我的action.json { "actions": [ { "description": "Default Welcome Intent", "name": "MAIN", "fulfillment"
action.json
{
"actions": [
{
"description": "Default Welcome Intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "welcome"
},
"intent": {
"name": "actions.intent.MAIN"
}
},
{
"description": "Example response",
"name": "Raw input",
"fulfillment": {
"conversationName": "rawInput"
},
"intent": {
"name": "raw.input",
"parameters": [
{
"name": "requestText",
"type": "SchemaOrg_Text"
}
],
"trigger": {
"queryPatterns": [
"$SchemaOrg_Text:requestText"
]
}
}
}
],
"conversations": {
"welcome": {
"name": "welcome",
"url": "https://myserver.com/api/request/gactions",
"fulfillmentApiVersion": 2
},
"rawInput": {
"name": "rawInput",
"url": "https://myserver.com/api/request/gactions",
"fulfillmentApiVersion": 2
}
}
}模拟器现在发送版本2,而我的应用程序尚未获得批准。以下是我得到的:
Request headers:
host: gactions.example.com
accept-encoding: gzip,deflate,br
content-type: application/json
google-actions-api-version: 2
user-agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
content-length: 380
x-forwarded-port: 443
x-forwarded-proto: https
x-forwarded-host: example.com
x-forwarded-server: ip-10-0-0-36.ec2.internal
connection: Keep-Alive
--------
Body of request:
{
"user": {
"userId": "1500679128193",
"locale": "en-US"
},
"conversation": {
"conversationId": "1500679128193",
"type": "NEW"
},
"inputs": [{
"intent": "actions.intent.MAIN",
"rawInputs": [{
"inputType": "KEYBOARD",
"query": "talk to tom's applicaiton"
}
]
}
],
"surface": {
"capabilities": [{
"name": "actions.capability.AUDIO_OUTPUT"
}, {
"name": "actions.capability.SCREEN_OUTPUT"
}
]
},
"device": {},
"isInSandbox": true
}
您是否已提交新的操作包以供审阅?否。我的应用未部署。我在第2版发布之前就开始制作了。我正在尝试准备提交初始应用程序,并希望首先使用我的实现服务器对其进行测试,以确保一切正常,但架构仍然是版本1。您的操作包是否使用fulfillmentApiVersion显式设置版本?我在上面添加了my action.json。以下是我在尝试上载时得到的信息:错误:未能更新应用程序以获取助手错误:接收到无效的JSON负载。未知名称“fulfillment\u api\u version”此页面说明使用:fulfillment\u api\u version。当我使用snake case时,我没有收到错误,但它仍然不能正常工作。它是fulfillmentApiVersion。我们会修好这些文件。当你使用它的时候,有什么是不正确的?