Gactions 项目正在发送版本 1 请求模式
Gactions project is sending version 1 request schema
根据此文档Actions on Google - Overview
Google 现在使用版本 2 JSON 架构,但我的服务器从模拟器接收的请求是版本 1。我需要做些什么才能获得 版本 2 JSON 架构?
我已将我的 gactions 项目 action.json 文件更新为新格式并上传。
这是我的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
}
根据此文档Actions on Google - Overview
Google 现在使用版本 2 JSON 架构,但我的服务器从模拟器接收的请求是版本 1。我需要做些什么才能获得 版本 2 JSON 架构?
我已将我的 gactions 项目 action.json 文件更新为新格式并上传。
这是我的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
}