Gactions项目正在发送版本1请求架构 [英] Gactions project is sending version 1 request schema

查看:64
本文介绍了Gactions项目正在发送版本1请求架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据本文档 Google上的操作-概述

Google现在正在使用版本2 JSON模式,但是我的服务器从模拟器接收的请求是版本1。我需要做些什么来获取版本2 JSON模式

Google is now using version 2 JSON schema, but the requests my server is receiving from the simulator is version 1. Is there something I need to do to get version 2 JSON schema?

我已将我的gactions项目action.json文件更新为新格式并上传了。

I have updated my gactions project action.json file to the new format and uploaded it.

这是我的 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而且我的申请还没有被批准。这是我得到的:

The simulator now sends version 2 and my application has not been approved yet. Here is what I get:

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
}

这篇关于Gactions项目正在发送版本1请求架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆