根据在线示例,我想尝试使用 Dialogflow Fulfillment 和内联编辑器添加丰富响应按钮和基本卡,但我没有在 Dialogflow Messenger 客户端中呈现任何内容。丰富的回复不完全支持吗?
根据自述文件,Dialogflow Fulfillment 库不再维护;因此,您似乎无法直接使用此库在 Dialogflow Messenger 中使用丰富的响应。
基于此,如果您想通过 Dialogflow Messenger 使用丰富的响应,您可以创建一个 webhook 服务。要开始测试此功能,我建议您执行以下操作:
1- 使用 Cloud Functions 创建 HTTP 函数。此文档提到了从 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
3- 测试您的 Dialogflow Messenger。
为什么所有的丰富消息(筹码)都会进入另一行。我不能把它们合并成一个吗?