我已经有了一个网络钩子,我正在用它来改变助手的答案。但我不知道如何发送建议卡或链接,因为您可以通过API.AI web (从add按钮)发送它们。
我应该以JSON object的形式以data的名字发送它们吗?

发布于 2017-08-26 00:25:03
JSON主体对API.AI实现webhook调用的响应的一般形式将包括一个针对简单响应的和一张卡片。如果要使用列表或旋转木马,文档是这里
{
"speech": "This is a API.AI default speech response",
"displayText": "This is a API.AI default display text response",
"data": {
"google": {
"expectUserResponse": true,
"isSsml": false,
"noInputPrompts": [],
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "This is a simple speech response for Actions on Google.",
"displayText": "This is a simple display text response for Action on Google."
}
},
{
"basicCard": {
"title": "Title: this is a title",
"subtitle": "This is a subtitle",
"formattedText": "This is a basic card. Text in a basic card can include \"quotes\" and most other unicode characters including emoji . Basic cards also support some markdown formatting like *emphasis* or _italics_, **strong** or __bold__, and ***bold itallic*** or ___strong emphasis___ as well as other things like line \nbreaks",
"image": {
"url": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
"accessibilityText": "Image alternate text"
},
"buttons": [
{
"title": "This is a button",
"openUrlAction": {
"url": "https://assistant.google.com/"
}
}
]
}
}
]
}
}
}
}https://stackoverflow.com/questions/45868524
复制相似问题