Google Assistant通过API.AI进行高级响应 [英] Google Assistant advanced responses with API.AI
本文介绍了Google Assistant通过API.AI进行高级响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经有了一个网络挂钩,并且我正在使用它来更改助理答案。 但是我不知道如何发送建议卡或链接,因为您可以从API.AIWeb GUI(从"添加内容"按钮)发送它们。
我是否应以data
名称将它们作为JSON object
发送。
推荐答案
API.AI实现WebHook调用的响应的JSON体的一般格式如下,该调用将包括一个简单响应的Action on Google Rich Response和一张卡片。如果要使用列表或旋转木马,文档为here:
{
"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
breaks",
"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/"
}
}
]
}
}
]
}
}
}
}
这篇关于Google Assistant通过API.AI进行高级响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文