在Dialogflow中发送自定义有效负载时遇到一些问题。我将Dialogflow与LINE Platform集成在一起。它具有某种称为flex的消息,您可以使用自定义有效负载来发送该消息。问题是当我设置了很长的有效负载时,什么也没有回复用户。但是对于较短的有效负载,可以将其发送回给用户。这是我的有效载荷的一些例子
无效负载
{
"line": {
"type": "flex",
"altText": "Flex Message",
"contents": {
"type": "carousel",
"contents": [
{
"type": "bubble",
"hero": {
"type": "image",
"url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/01_5_carousel.png",
"size": "full",
"aspectRatio": "20:13",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "Arm Chair, White",
"size": "xl",
"weight": "bold",
"wrap": true
},
{
"type": "box",
"layout": "baseline",
"contents": [
{
"type": "text",
"text": "$49",
"flex": 0,
"size": "xl",
"weight": "bold",
"wrap": true
},
{
"type": "text",
"text": ".99",
"flex": 0,
"size": "sm",
"weight": "bold",
"wrap": true
}
]
}
]
},
"footer": {
"type": "box",
"layout": "vertical",
"spacing": "sm",
"contents": [
{
"type": "button",
"action": {
"type": "uri",
"label": "Add to Cart",
"uri": "https://linecorp.com"
},
"style": "primary"
},
{
"type": "button",
"action": {
"type": "uri",
"label": "Add to whishlist",
"uri": "https://linecorp.com"
}
}
]
}
},
{
"type": "bubble",
"hero": {
"type": "image",
"url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/01_6_carousel.png",
"size": "full",
"aspectRatio": "20:13",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "Metal Desk Lamp",
"size": "xl",
"weight": "bold",
"wrap": true
},
{
"type": "box",
"layout": "baseline",
"flex": 1,
"contents": [
{
"type": "text",
"text": "$11",
"flex": 0,
"size": "xl",
"weight": "bold",
"wrap": true
},
{
"type": "text",
"text": ".99",
"flex": 0,
"size": "sm",
"weight": "bold",
"wrap": true
}
]
},
{
"type": "text",
"text": "Temporarily out of stock",
"flex": 0,
"margin": "md",
"size": "xxs",
"color": "#FF5551",
"wrap": true
}
]
},
"footer": {
"type": "box",
"layout": "vertical",
"spacing": "sm",
"contents": [
{
"type": "button",
"action": {
"type": "uri",
"label": "Add to Cart",
"uri": "https://linecorp.com"
},
"flex": 2,
"color": "#AAAAAA",
"style": "primary"
},
{
"type": "button",
"action": {
"type": "uri",
"label": "Add to wish list",
"uri": "https://linecorp.com"
}
}
]
}
},
{
"type": "bubble",
"body": {
"type": "box",
"layout": "vertical",
"spacing": "sm",
"contents": [
{
"type": "button",
"action": {
"type": "uri",
"label": "See more",
"uri": "https://linecorp.com"
},
"flex": 1,
"gravity": "center"
}
]
}
}
]
}
}
}
有效负载
{
"line":{
"type": "flex",
"altText": "Flex Message",
"contents": {
"type": "bubble",
"direction": "ltr",
"header": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "Header",
"align": "center"
}
]
},
"hero": {
"type": "image",
"url": "https://developers.line.biz/assets/images/services/bot-designer-icon.png",
"size": "full",
"aspectRatio": "1.51:1",
"aspectMode": "fit"
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "Body",
"align": "center"
}
]
},
"footer": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "button",
"action": {
"type": "uri",
"label": "Button",
"uri": "https://linecorp.com"
}
}
]
}
}
}
}
我已经检查了两个有效载荷在LINE平台中是否均已纠正,并且可以使用外部工具发送。
我的想法,在Dialogflow中使用自定义有效负载存在有效负载大小限制或其他限制。
有人对此有想法吗?