我正在使用 Google 操作。当我在模拟器中测试我的操作时,我从我的 webhook 返回 JSON 并收到以下错误:
“由于缺少插槽的类型覆盖,无法呈现列表或集合提示。注意,列表和集合只能用于插槽填充。应该有相应的类型覆盖来描述如何呈现此类型的列表或集合。 "
JSON 是从https://developers.google.com/assistant/conversational/prompts-selection上的文档中获取的稍作修改的示例。
typeOverrides 名称“items”与场景的插槽名称匹配。
这是 webhook 请求和响应 JSON。
*** 要求 ***
{
"handler": {
"name": "aa"
},
"intent": {
"name": "searchIntent",
"params": {
"searchParm": {
"original": "milk",
"resolved": "milk"
}
},
"query": "milk"
},
"scene": {
"name": "Start",
"slotFillingStatus": "UNSPECIFIED",
"slots": {},
"next": {
"name": "SearchScene"
}
},
"session": {
"id": "ABwppHGln0UTzfUPqJ1SMr1Cuw2TyPjJQoGUkULazcObus3vUwJCJCpba--5PSRwjqMQelRqMAUnwPvl",
"params": {},
"typeOverrides": [],
"languageCode": ""
},
"user": {
"locale": "en-AU",
"params": {},
"accountLinkingStatus": "ACCOUNT_LINKING_STATUS_UNSPECIFIED",
"verificationStatus": "VERIFIED",
"packageEntitlements": [],
"lastSeenTime": "2020-11-05T21:24:16Z"
},
"home": {
"params": {}
},
"device": {
"capabilities": [
"SPEECH",
"RICH_RESPONSE",
"LONG_FORM_AUDIO"
]
}
}
*** 回复 ***
{
"session": {
"id": "ABwppHGln0UTzfUPqJ1SMr1Cuw2TyPjJQoGUkULazcObus3vUwJCJCpba--5PSRwjqMQelRqMAUnwPvl",
"params": {},
"typeOverrides": [
{
"name": "items",
"synonym": {
"entries": [
{
"name": "ITEM_1",
"synonyms": [
"Item 1",
"First item"
],
"display": {
"title": "Item #1",
"description": "Description of Item #1",
"image": {
"alt": "Google Assistant logo",
"height": 0,
"url": "https://developers.google.com/assistant/assistant_96.png",
"width": 0
}
}
},
{
"name": "ITEM_2",
"synonyms": [
"Item 2",
"Second item"
],
"display": {
"title": "Item #2",
"description": "Description of Item #2",
"image": {
"alt": "Google Assistant logo",
"height": 0,
"url": "https://developers.google.com/assistant/assistant_96.png",
"width": 0
}
}
},
{
"name": "ITEM_3",
"synonyms": [
"Item 3",
"Third item"
],
"display": {
"title": "Item #3",
"description": "Description of Item #3",
"image": {
"alt": "Google Assistant logo",
"height": 0,
"url": "https://developers.google.com/assistant/assistant_96.png",
"width": 0
}
}
},
{
"name": "ITEM_4",
"synonyms": [
"Item 4",
"Fourth item"
],
"display": {
"title": "Item #4",
"description": "Description of Item #4",
"image": {
"alt": "Google Assistant logo",
"height": 0,
"url": "https://developers.google.com/assistant/assistant_96.png",
"width": 0
}
}
}
]
},
"typeOverrideMode": "TYPE_REPLACE"
}
]
},
"prompt": {
"override": false,
"content": {
"list": {
"items": [
{
"key": "ITEM_1"
},
{
"key": "ITEM_2"
},
{
"key": "ITEM_3"
},
{
"key": "ITEM_4"
}
],
"subtitle": "List subtitle",
"title": "List title"
}
},
"firstSimple": {
"speech": "This is a list.",
"text": "This is a list."
}
}
}