繁体   English   中英

Google Assistant使用API​​.AI进行高级响应

[英]Google Assistant advanced responses with API.AI

我已经有一个Webhook,并且正在使用它来更改助理答案。 但是我不知道如何发送建议卡或链接,因为您可以从API.AI Web GUI( 通过添加内容按钮 )发送建议卡或链接。

我应该以data名称下的JSON object发送它们JSON object

https://api.ai/docs/fulfillment#response API.AI Webhook文档

对API.AI履行Webhook调用的响应的JSON主体的一般形式,下面将包括一个针对Google Rich响应的Action(用于简单响应)和卡片。 如果要使用列表或轮播,请在此处找到文档:

{
  "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/"
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM