首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >谷歌助理与API.AI的高级回应

谷歌助理与API.AI的高级回应
EN

Stack Overflow用户
提问于 2017-08-24 18:23:40
回答 1查看 849关注 0票数 2

我已经有了一个网络钩子,我正在用它来改变助手的答案。但我不知道如何发送建议卡或链接,因为您可以通过API.AI web (从add按钮)发送它们。

我应该以JSON object的形式以data的名字发送它们吗?

API.AI网页钩子文档

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-26 00:25:03

JSON主体对API.AI实现webhook调用的响应的一般形式将包括一个针对简单响应的和一张卡片。如果要使用列表或旋转木马,文档是这里

代码语言:javascript
运行
复制
{
  "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/"
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45868524

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档