Google Google 助理高级回复 API.AI

Google Assistant advanced responses with API.AI

我已经有一个 webhook,我正在用它来更改助手答案。 但我不知道如何发送建议卡或 link,因为您可以从 API.AI 网络 GUI (来自添加内容按钮).

我是否应该以 data 的名义将它们作为 JSON object 发送。

API.AI webhook documentation

JSON 对 API.AI fulfillment webhook 调用的响应正文的一般形式,其中将包括对 Google 丰富响应的操作,用于简单响应和卡片以下。如果您想使用列表或轮播,文档是 here:

{
  "speech": "This is a API.AI default speech response",
  "displayText": "This is a API.AI default display text response",
  "data": {
    "google": {
      "expectUserResponse": true,
      "isSsml": false,
      "noInputPrompts": [],
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "textToSpeech": "This is a simple speech response for Actions on Google.",
              "displayText": "This is a simple display text response for Action on Google."
            }
          },
          {
            "basicCard": {
              "title": "Title: this is a title",
              "subtitle": "This is a subtitle",
              "formattedText": "This is a basic card.  Text in a basic card can include \"quotes\" and most other unicode characters including emoji .  Basic cards also support some markdown formatting like *emphasis* or _italics_, **strong** or __bold__, and ***bold itallic*** or ___strong emphasis___ as well as other things like line  \nbreaks",
              "image": {
                "url": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
                "accessibilityText": "Image alternate text"
              },
              "buttons": [
                {
                  "title": "This is a button",
                  "openUrlAction": {
                    "url": "https://assistant.google.com/"
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}