嗨,我正在从DialogFlow发送具有丰富响应的响应。这个丰富的响应包含Carousel,但我只看到简单的响应。我在GA中没有看到轮播的响应。我的响应有任何缺陷吗?我没有在控制台操作模拟器中看到任何错误。
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Please follow these steps:",
"displayText": "Please follow these steps:"
},
"Carousel": {
"items": [
{
"title": "Step 1/6",
"description": "hello",
"image": {
"url": "https://www.xx",
"accessibilityText": "hello"
}
},
{
"title": "Step 2/6",
"description": "hello",
"image": {
"url": "https://www.xx",
"accessibilityText": "hello"
}
},
]
}
}
],
"suggestions": []
}
}
}
}
答案 0 :(得分:1)
如果直接将JSON发送回,则Carousel和List对象不是richResponse
属性的一部分。而是在systemIntent
属性的子级中指定它们。
整个响应可能看起来像这样
{
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Choose a item"
}
}
]
},
"systemIntent": {
"intent": "actions.intent.OPTION",
"data": {
"@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
"carouselSelect": {
"items": [
{
"optionInfo": {
"key": "first title"
},
"description": "first description",
"image": {
"url": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
"accessibilityText": "first alt"
},
"title": "first title"
},
{
"optionInfo": {
"key": "second"
},
"description": "second description",
"image": {
"url": "https://lh3.googleusercontent.com/Nu3a6F80WfixUqf_ec_vgXy_c0-0r4VLJRXjVFF_X_CIilEu8B9fT35qyTEj_PEsKw",
"accessibilityText": "second alt"
},
"title": "second title"
}
]
}
}
}
}
}
}