[英]Creating agnostic cards outside inline editor using dialogflow
I want to create cards in my Dialogflow webhook developed in Python.我想在 Python 开发的 Dialogflow webhook 中创建卡片。 I know how to do it in the Inline Editor:
我知道如何在内联编辑器中做到这一点:
agent.add(new Card({
title: '*How has the COVID-19 crisis :mask:*',
text: 'impacted the stability of your life?',
})
);
agent.add(new Suggestion("1 :cold_sweat: *more exasperated and hopeless*"));
agent.add(new Suggestion("2 :expressionless: *less freaked out than other people*"));
agent.add(new Suggestion("3 :relieved: *More calm and hopeful*"));
agent.add(new Suggestion("4 :fearful: *More scared and panicked*"));
agent.add(new Suggestion("5 :smiley: *More surprised and baffled*"));
However I have to disallow the inline editor when using a self designed webhook.但是,在使用自行设计的 webhook 时,我必须禁止内联编辑器。 I don't know how to create the same card with button messages to use it on a self designed website, either from the app with Post request from my Flask app, or using the custom payload option.
我不知道如何创建带有按钮消息的同一张卡片,以便在自行设计的网站上使用它,无论是来自我的 Flask 应用程序的发布请求的应用程序,还是使用自定义有效负载选项。
How to create cards from custome payload or app from post requests?如何从客户有效负载或来自发布请求的应用程序创建卡片?
My website is based on this repository我的网站基于此存储库
I would look at pydialogflow-fulfillment module: it works with Flask and gives you an SDK to create the main response types (text response, suggested actions):我会看一下pydialogflow-fulfillment模块:它与 Flask 一起使用,并为您提供 SDK 来创建主要响应类型(文本响应,建议的操作):
dialogflow_response.add(Suggestions(["Option 1","Option 2","Option 3"]))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.