![](/img/trans.png)
[英]GCP DialogFlow CX - returning choice list / buttons in webhook response fulfillment_response or using parameters in custom payload to provide choices
[英]How to show Rich Response Buttons (''Chips) Using Dialogflow Fulfillment?
根据自述文件,不再维护 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
部署函数。 之后,输入您的函数并在“触发器”部分中复制触发器 URL
2- 在 Dialogflow 中启用和管理履行
3- 测试您的 Dialogflow 信使。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.