[英]DialogFlow Google Assistant Webhook Response: “Empty speech response”
我在使用Dialogflow的Fulfillment / Webhook时遇到了一些麻烦。 我创建了一个Intent,它接受一个参数作为输入(引脚号)。 使用Webhook调用在服务器端“验证”该引脚。 也就是说,选中“为此意图启用webhook调用”。 该方法在成功验证时返回正消息。
只要我使用Dialogflow控制台的“立即尝试”窗口,整个场景就能完美运行。 但是当我尝试在Google智能助理模拟器中测试时,它会响应:
也,
这是意图:
我已设置从Webhook调用返回的响应:
"messages": [
{
"speech": "Thanks. Your pin has been confirmed.",
"type": 0
}
此处的示例响应: https : //dialogflow.com/docs/fulfillment
请注意,我已经检查了错误“空语音响应” 。 它没有帮助。
这是一个很好的问题,文档对于有效的回复看起来有点不清楚。
在回复Google智能助理的消息时,您应该使用speech
和displayText
参数进行响应。 所以等效的反应会是这样的
{
"speech": "Thanks. Your pin has been confirmed.",
"displayText": "Thank you. We have confirmed your PIN and you can proceed."
}
但是,如果您要在Google功能(卡片,功能请求等)上执行其他操作,或者甚至只是在与用户交谈时保持对话打开,那么您需要将data.google
对象用作以及可能包含simpleResponse
作为回复的一部分。 这可能看起来像这样:
{
"speech": "Thanks. Your pin has been confirmed.",
"displayText": "Thank you. We have confirmed your PIN and you can proceed.",
"data": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Thanks. Your pin has been confirmed.",
"displayText": "Thank you. We have confirmed your PIN and you can proceed."
}
}
]
}
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.