Webhook使用“建议芯片”的响应 [英] Webhook response with "suggestion chips"
问题描述
我想基于Webhook响应并使用建议芯片来指导用户。从webhook示例中,我看到以下结构:
I would like to guide users based on webhook response with suggestions chips. From webhook sample, I see below structure:
"fulfillment": {
"speech": "Today in Boston: Fair, the temperature is 37 F",
"source": "apiai-weather-webhook-sample",
"displayText": "Today in Boston: Fair, the temperature is 37 F"
}
但是,如果我想建议用户下一步,您可以要求继续进行对话,然后如何在webhook响应中传递建议筹码?
But, if I want to suggest users what next you can request to continue the conversation, then how do I pass suggestions chips in webhook response?
推荐答案
您显示的响应是基本的API.AI响应格式。但是, Google上的操作对此进行了扩展,主要使用data.google字段,如下所示:
The response you displayed is the basic API.AI response format. However, Actions on Google expands on this and mainly uses the data.google field as presented below:
{
"speech":"This is a simple response with suggestion chips",
"data": {
"google":
{
"expectUserResponse":true,
"richResponse":
{
"items":
[
{
"simpleResponse":
{
"textToSpeech":"This is a simple response for with suggestion chips"
}
}
],
"suggestions":
[
{
"title":"Option 1"
},
{
"title":"Option 2"
}
]
}
}
}
}
请务必注意,这仅显示有关Google行动应用程式,它不会对Facebook等功能做任何事情。
It is important to note, that this only displays suggestions for an actions-on-google application, it won't do anything for stuff like Facebook etc.
这篇关于Webhook使用“建议芯片”的响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!