簡體   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