Dialogflow 响应:google 上的操作
Dialog Flow Response: actions On google
我有一个简单的响应,从 dialogflow 到 Google 助手的 BasicCard.The 响应是这样的:
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)",
"displayText": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)"
},
"basicCard": {
"image": {
"url": "https://",
"accessibilityText": "The model number can be found here "
},
"title": "The model number can be found on here,
"subtitle": "It is also called Set-Type,"
}
}
],
"suggestions": []
}
}
}
在 GA 的响应中,模拟器出现以下错误:
expected_inputs[0].input_prompt.rich_initial_prompt: the first element must be a 'simple_response', a 'structured_response' or a 'custom_response'.
GA 响应我在模拟器中没有看到简单响应。简单响应在某个地方被丢弃了。DialogFlow 的这个响应有什么缺陷吗?
问题是 items[]
数组中的每个对象都应该有一个字段来指示项目的类型。所以一个项目将有一个 simpleResponse
属性和相应的值。另一项将具有 basicCard
属性,以及它的所有值。
您似乎在 items[]
数组中有一个对象具有两个属性,simpleResponse
和 basicCard
。将它们拆分为数组中的两个对象。像这样:
"items": [
{
"simpleResponse": {
"textToSpeech": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)",
"displayText": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)"
}
},
{
"basicCard": {
"image": {
"url": "https://",
"accessibilityText": "The model number can be found here "
},
"title": "The model number can be found on here,
"subtitle": "It is also called Set-Type,"
}
}
],
我有一个简单的响应,从 dialogflow 到 Google 助手的 BasicCard.The 响应是这样的:
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)",
"displayText": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)"
},
"basicCard": {
"image": {
"url": "https://",
"accessibilityText": "The model number can be found here "
},
"title": "The model number can be found on here,
"subtitle": "It is also called Set-Type,"
}
}
],
"suggestions": []
}
}
}
在 GA 的响应中,模拟器出现以下错误:
expected_inputs[0].input_prompt.rich_initial_prompt: the first element must be a 'simple_response', a 'structured_response' or a 'custom_response'.
GA 响应我在模拟器中没有看到简单响应。简单响应在某个地方被丢弃了。DialogFlow 的这个响应有什么缺陷吗?
问题是 items[]
数组中的每个对象都应该有一个字段来指示项目的类型。所以一个项目将有一个 simpleResponse
属性和相应的值。另一项将具有 basicCard
属性,以及它的所有值。
您似乎在 items[]
数组中有一个对象具有两个属性,simpleResponse
和 basicCard
。将它们拆分为数组中的两个对象。像这样:
"items": [
{
"simpleResponse": {
"textToSpeech": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)",
"displayText": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)"
}
},
{
"basicCard": {
"image": {
"url": "https://",
"accessibilityText": "The model number can be found here "
},
"title": "The model number can be found on here,
"subtitle": "It is also called Set-Type,"
}
}
],