【发布时间】:2020-10-06 21:26:24
【问题描述】:
基于在线示例,我想尝试使用 Dialogflow Fulfillment 和内联编辑器添加丰富的响应按钮和基本卡,但我没有在 Dialogflow Messenger 客户端中呈现任何内容。不完全支持丰富的响应吗?
【问题讨论】:
标签: google-cloud-platform dialogflow-es dialogflow-es-fulfillment
基于在线示例,我想尝试使用 Dialogflow Fulfillment 和内联编辑器添加丰富的响应按钮和基本卡,但我没有在 Dialogflow Messenger 客户端中呈现任何内容。不完全支持丰富的响应吗?
【问题讨论】:
标签: google-cloud-platform dialogflow-es dialogflow-es-fulfillment
根据自述文件,不再维护 Dialogflow Fulfillment 库;因此,您似乎无法在 Dialogflow messenger 中直接使用此库来使用丰富的响应。
基于此,如果您想通过 Dialogflow Messenger 使用丰富的响应,您可以创建一个webhook service。要开始测试,我建议您执行以下操作:
1- 使用 Cloud Functions 创建 HTTP 函数。这个documentation 提到了从 Cloud Console 创建一个的过程。请在第二步中考虑到这一点:
from flask import jsonify
def entry_function(request):
response_json = jsonify(
fulfillment_text="This message is from Dialogflow's testing!",
fulfillment_messages=[
{
"payload": {
"richContent": [[{
"actionLink": "https://assistant.google.com/",
"subtitle": "This is the body text of a card. You can even use line\n breaks and emoji! ?",
"title": "Title: this is a card title",
"type": "info"
}]]
}
}
]
)
return response_json
部署函数。然后,输入您的函数并在“TRIGGER”部分复制触发器 URL
2- Dialogflow 中的Enable and manage fulfillment
3- 测试您的 Dialogflow Messenger。
【讨论】: