本文介绍了如何使用IBM Watson Assistant对话框做Messenger的通用模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个来自IBM Watson的正在工作的助手,我想显示多个选择作为图像",描述"和链接"组合,此功能可在通用模板,但是我在对话框响应中找不到选项,可以让我图片

I have a working Assistant from IBM Watson I want to show multiple choices as Image, Description, and Link combinations this feature is available for messenger under Generic Template but I cant find an option at dialog responses that can get me do this image

{
"output": {
    "generic": [
        {
            "values": [
                {
                    "text": "I got that"
                }
            ],
            "response_type": "text",
            "selection_policy": "sequential"
        }
    ],
    "facebook": {
        "message": {
            "attachment": {
                "type": "template",
                "payload": {
                    "template_type": "generic",
                    "elements": [
                        {
                            "title": "Welcome!",
                            "image_url": "https://petersfancybrownhats.com/company_image.png",
                            "subtitle": "We have the right hat for everyone.",
                            "default_action": {
                                "type": "web_url",
                                "url": "https://petersfancybrownhats.com/view?item=103",
                                "webview_height_ratio": "tall"
                            },
                            "buttons": [
                                {
                                    "type": "web_url",
                                    "url": "https://petersfancybrownhats.com",
                                    "title": "View Website"
                                },
                                {
                                    "type": "postback",
                                    "title": "Start Chatting",
                                    "payload": "DEVELOPER_DEFINED_PAYLOAD"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    }
}

}

我在对话框节点上使用此JSON失败

I have used this JSON at the dialog node with no success

推荐答案

如果有人遇到相同的问题,则应使用output.integrations.facebook而不是output.facebook

If any one is facing the same problem you should do it as output.integrations.facebook not output.facebook

所以物体会像那样飞扬

{
"output": {
    "generic": [
        {
            "values": [
                {
                    "text": "I got that"
                }
            ],
            "response_type": "text",
            "selection_policy": "sequential"
        }
    ],
    "facebook": {
        "message": {
            "attachment": {
                "type": "template",
                "payload": {
                    "template_type": "generic",
                    "elements": [
                        {
                            "title": "Welcome!",
                            "image_url": "https://petersfancybrownhats.com/company_image.png",
                            "subtitle": "We have the right hat for everyone.",
                            "default_action": {
                                "type": "web_url",
                                "url": "https://petersfancybrownhats.com/view?item=103",
                                "webview_height_ratio": "tall"
                            },
                            "buttons": [
                                {
                                    "type": "web_url",
                                    "url": "https://petersfancybrownhats.com",
                                    "title": "View Website"
                                },
                                {
                                    "type": "postback",
                                    "title": "Start Chatting",
                                    "payload": "DEVELOPER_DEFINED_PAYLOAD"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    }
}
}

这篇关于如何使用IBM Watson Assistant对话框做Messenger的通用模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 10:06