问题描述
我有一个来自IBM Watson的工作助手,我想显示多种选择,例如图像,说明和链接组合,此功能可在Generic Template下供Messenger使用,但我无法在对话框响应中找到可以让我了解的选项为此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失败
解决方法
如果有人遇到相同的问题,则应按照output.integrations.facebook
而不是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"
}
]
}
]
}
}
}
}
}
}