如果这是一个愚蠢的问题,我道歉 . 我花了很长时间尝试获取我的Google助手应用程序的每日更新(在https://developers.google.com/actions/assistant/updates/daily找到) .
我在手机上收到提示以启动每日更新,因为我的服务器获取了配置更新事件 . 但是,我想我没有发回正确的响应,因为我刚收到错误“UnparseableJsonResponse:API Version 2:无法用'INVALID_ARGUMENT'错误解析JSON响应字符串:”:找不到该字段 . “
通常,我的服务器只响应结构中的JSON:
return{
"speech": 'sample text',
"DisplayText": 'sample text',
"source": "sample"
}
但是,根据Google文档,我需要返回JSON
{
"conversationToken":"",
"expectUserResponse":true,
"expectedInputs":[
{
"inputPrompt":{
"initialPrompts":[
{
"textToSpeech":"PLACEHOLDER_FOR_REGISTER_UPDATE"
}
],
"noInputPrompts":[
]
},
"possibleIntents":[
{
"intent":"actions.intent.REGISTER_UPDATE",
"inputValueData":{
"":"",
"intent":"tell.tip",
"triggerContext":{
"timeContext":{
"frequency":"DAILY"
}
},
}
}
]
}
]
}
我尝试返回这个确切的JSON,但我怀疑它's not that simple. I'我不知道如何使这种格式适应对话框流程所期望的 . 任何帮助将非常感激 . 请注意,我正在查看https://dialogflow.com/docs/fulfillment处的响应结构 . 我也在https://developers.google.com/actions/reference/rest/Shared.Types/AppResponse考虑了谷歌结构上的行动 . 我对如何执行此操作非常困惑,因为该指南主要适用于使用节点js和SDK的人 .