在机器人对话中使用轮播

轮播是包含一系列卡片的机器人回复。 要与轮播互动,客户可以滚动浏览卡片选项,然后使用与卡片关联的按钮选择一个选项。

轮播通过提供具有自动化体验的高级选项和操作来促进机器人对话。 Carousels 通过展示一系列卡片,包括描述、图像、标题、文本以及可选的外部网站推荐,为客户提供了一套复杂的选项。 有关卡片的更多信息,请参阅在机器人对话中使用卡片

示例 Genesys Web Messenger 中的轮播

旋转木马动画

机器人和渠道支持

目前支持的机器人:

  • Amazon Lex V2
  • Google Dialogflow
  • Google Dialog Flow CX
  • Bot Connector

目前支持的机器人:

  • Facebook Messenger
  • Genesys Web 消息传递
  • LINE
  • Instagram(测试版)

当你在机器人回复中设计和实现轮播结构时,请考虑以下限制:

  • 你可以在单个轮播中实现最多 10 张牌。
  • 您在卡片结构中的按钮上配置的有效负载在轮播中的所有卡片中必须是唯一的。
  • Twitter 和 WhatsApp 不支持轮播结构。
  • 亚马逊 Lex V1 将自定义 JSON 限制为 1000 个字符。 如果您必须使用超过 1000 个字符来创建轮播,则此限制可能会影响实现。
  • WhatsApp、LINE 或 Twitter 不支持默认操作。 如果在这些应用程序中配置默认操作,则应用程序将忽略它们。

Amazon Lex V2

这些部分介绍了如何将轮播加入到您的 Amazon Lex V1 机器人中,并包括使用案例示例和其他资源。

注意: 您还可以通过 AWS UI 设置卡片。 参见下一节使用案例: 插槽填充
  1. 安装来自 Genesys AppFoundry 的亚马逊 Lex 集成
  2. 使用 Amazon Lex 应用程序的权限配置 IAM 角色
  3. 在 Genesys Cloud 中配置并激活 Lex 集成
  4. 要在 AWS Lex 控制台中设置轮播选项,请使用此自定义 JSON 来定义符合机器人意图的卡片:
    注意: 亚马逊 Lex V1 将 JSON 长度限制为 1000 个字符。
{
    "genesys_prompt": "String", // optional message text
    "genesys_carousel": [
         {
              "title": "String", // mandatory text to show in the title
              "description": "String", // optional text to show in the description
              "image": "URL", // optional URL of an image
              "defaultAction":  { // optional default button action
                    "type": "String", // Describes the type of action. Valid values Link Postback
                    "text": "String", // The response text from the button click
                    "payload": "String", // Text to be returned as the payload from a ButtonResponse when a button is clicked. The payload and text are a combination which will have to be unique across each card and carousel in order to determine which button was clicked in that card or carousel.
                    "url": "String" // A URL of a web page to direct the user to.
              },
              "actions": [
                    {                                      
                         "type": "String", // Describes the type of action.  Valid values Link Postback
                         "text": "String", // The response text from the button click
                         "payload": "String" // Text to be returned as the payload from a ButtonResponse when a button is clicked. The payload and text are a combination which will have to be unique across each card and carousel in order to determine which button was clicked in that card or carousel.
                    },
                    {
                         "type": "String", // Describes the type of action.  Valid values Link Postback
                         "text": "String", // The response text from the button click
                         "url": "String" // A URL of a web page to direct the user to.
                    }
              ]
         }
    ]
}

要使用卡片选项来填补机器人的位置,请使用 AWS 控制台卡片编辑器。 要创建轮播,请使用 “添加卡片” 选项,然后向轮播中添加更多卡片。

点击图片放大。

亚马逊 Lex V1 中的卡片

注意: 仅通过自定义 JSON 支持 Web URL 按钮。 有关更多信息,请参阅下一节。
 

要使用轮播选项在机器人的意图之间切换,请在 AWS Lex 控制台中,将上一部分中的自定义 JSON 复制到响应输入字段。 定义多个卡片结构以创建轮播。

点击图片放大。

旋转木马亚马逊 Lex

 

仅限谷歌 DialogFlow ES:

这些部分描述了如何将轮播整合到你的 Google Dialogflow ES 或 CX 机器人中,并包括用例示例和其他资源。

  1. 安装来自 Genesys AppFoundry 的谷歌对话流集成
  2. 配置谷歌 Dialogflow 平台服务帐号凭据
  3. 启用谷歌对话流集成
  4. 要在 Dialogflow 控制台中设置轮播,请使用此自定义 JSON 来定义符合机器人意图的卡片选项。 使用多个卡片结构创建轮播。
{
   "genesys_prompt": "String", // optional message text
   "genesys_carousel": [
        {
             "title": "String", // mandatory text to show in the title
             "description": "String", // optional text to show in the description
             "image": "URL", // optional URL of an image
             "defaultAction":  { // optional default button action
                   "type": "String", // Describes the type of action. Valid values Link Postback
                   "text": "String", // The response text from the button click
                   "payload": "String", // Text to be returned as the payload from a ButtonResponse when a button is clicked. The payload and text are a combination which will have to be unique across each card and carousel in order to determine which button was clicked in that card or carousel.
                   "url": "String" // A URL of a web page to direct the user to.
             },
             "actions": [
                   {                                      
                        "type": "String", // Describes the type of action.  Valid values Link Postback
                        "text": "String", // The response text from the button click
                        "payload": "String" // Text to be returned as the payload from a ButtonResponse when a button is clicked. The payload and text are a combination which will have to be unique across each card and carousel in order to determine which button was clicked in that card or carousel.
                   },
                   {
                        "type": "String", // Describes the type of action.  Valid values Link Postback
                        "text": "String", // The response text from the button click
                        "url": "String" // A URL of a web page to direct the user to.
                   }
             ]
        }
   ]
}

要使用轮播选项在机器人的意图之间切换,请在 Dialogflow 控制台中将上一节中的自定义 JSON 添加到响应输入字段:

谷歌云 DialogFlow ES 示例

点击图片放大。

谷歌云 DialogFlow ES 轮播意图切换

要使用轮播选项来填补机器人的位置,请使用上一节中的自定义 JSON 到 web 挂钩中。 使用多个卡片结构创建轮播。 您也可以为此目的使用 AWS Lambda。 有关更多信息,请参阅 Google Cloud Dialogflow ES 指南中用于填充插槽的 Webhook。

了解更多

Bot Connector

这些章节介绍了如何将快速回复整合到 Genesys Bot Connector 机器人中,以及如何包含其他资源。