dialogflow-es - 对话流响应:Google 上的操作
问题描述
嗨,我正在从 DialogFlow 发送具有丰富响应的响应。这个丰富的响应包含轮播,但我只看到简单的响应。我在 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": []
}
}
}
}
解决方案
如果您直接发回 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"
}
]
}
}
}
}
}
}
推荐阅读
- angular - 如何在模态单击时在 mat-table 中默认检查 angular8 中特定行的复选框?
- node.js - 我没有得到 jwt 令牌
- numpy - 计算两个numpy数组的向量之间的距离
- azure-keyvault - Spinnaker - Azure 密钥库集成
- wordpress - 创建自定义 WP 查询以获取自定义帖子类型
- javascript - 我想用 AJAX 从另一个域调用服务并得到 CORS 错误
- chatbot - 聊天机器人中的多个意图处理
- firebase - 如何使用问答应用 Flutter Firebase 设置我的数据库
- json - 如何为 Xero 构建自定义 Zapier 集成
- migration - Salesforce 和 Mulesoft 集成 || 读取 Excel 文件