什么是 Gactions SIGN_IN intent JSON 响应格式

What is Gactions SIGN_IN intent JSON response format

有人可以给我一个 JSON Google 返回 actions.intent.SIGN_IN 意图时期望的例子吗?我正在尝试让我的应用获得批准,但我认为我返回的 JSON 无效。 Google 支持只是告诉我我的应用程序运行状况不佳且无法正确响应。下面是 JSON 我返回到我的服务器的履行请求:

{
    "expectUserResponse": true,
    "expectedInputs": [{
            "inputPrompt": {
                "initialPrompts": [{
                        "textToSpeech": "You must link your Google Assistant."
                    }
                ],
                "noInputPrompts": []
            },
            "possibleIntents": [{
                    "intent": "actions.intent.SIGN_IN"
                }
            ]
        }
    ]
}

记录了 JSON 格式:

{
  "conversationToken": "{\"state\":null,\"data\":{}}",
  "expectUserResponse": true,
  "expectedInputs": [
    {
      "inputPrompt": {
        "initialPrompts": [
          {
            "textToSpeech": "PLACEHOLDER_FOR_SIGN_IN"
          }
        ],
        "noInputPrompts": []
      },
      "possibleIntents": [
        {
          "intent": "actions.intent.SIGN_IN",
          "inputValueData": {}
        }
      ]
    }
  ]
}

https://developers.google.com/actions/identity/account-linking#json

Leons link 上面的内容似乎不再指向答案(也许是 V1?)。事实上,除非您使用 Google NodeJS SDK,否则很难找到答案。这个link:

https://developers.google.com/actions/build/json/dialogflow-webhook-json

提供一些信息 - 查找 actions.intent.SIGN_IN。 SignInValueSpec 数据规范在这里:

https://developers.google.com/actions/reference/rest/Shared.Types/SignInValueSpec

你最终得到这样的回复:

{
  "payload": {
    "google": {
      "expectUserResponse": true,
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "textToSpeech": "Please sign in"
            }
          }
        ]
      },
      "systemIntent": {
        "intent": "actions.intent.SIGN_IN",
        "data": {
          "@type": "type.googleapis.com/google.actions.v2.SignInValueSpec",
          "optContext": "To verify your age"
        }
      }
   }
}