这是this的后续问题。我想在我的助手命令中使用2个参数。当我只使用一个参数作为命令时,代码运行完美。但是,当我向查询模式添加第二个参数时,从未检测到模式。我在下面粘贴了我的动作json文件。我错过了什么?
{
"manifest": {
"displayName": "Start Test",
"invocationName": "Start Test",
"category": "PRODUCTIVITY"
},
"actions": [
{
"name": "com.example.actions.StartTest",
"availability": {
"deviceClasses": [
{
"assistantSdkDevice": {}
}
]
},
"intent": {
"name": "com.example.intents.StartTest",
"parameters": [
{
"name": "testname",
"type" : "TestSchema"
},
{
"name": "machinename",
"type" : "MachineSchema"
}
],
"trigger": {
"queryPatterns": [
"prepare ($TestSchema:testname) on ($MachineSchema:machinename)",
"start ($TestSchema:testname) on ($MachineSchema:machinename)",
"launch ($TestSchema:testname) on ($MachineSchema:machinename)"
]
}
},
"fulfillment": {
"staticFulfillment": {
"templatedResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Preparing to start test $testname on $machinename"
}
},
{
"deviceExecution": {
"command": "com.example.commands.StartTest",
"params": {
"testname": "$testname",
"machinename": "$machinename"
}
}
}
]
}
}
}
}
],
"types": [
{
"name": "$TestSchema",
"entities": [
{
"key": "BURN IN",
"synonyms": [
"burnin",
"burn in",
"burning",
"button"
]
},
{
"key": "WINTHRAX",
"synonyms": [
"when thanks",
"print tracks",
"fintrax",
"win tracks",
"winter sucks"
]
},
{
"key": "REBOOTER",
"synonyms": [
"reporter",
"repeat here",
"reboot"
]
},
{
"key": "SLEEPER",
"synonyms": [
"sleeper",
"sleep here",
"slipper"
]
},
{
"key": "IOMONKEY",
"synonyms": [
"are you monkey",
"I O monkey",
"I am monkey"
]
},
{
"key": "DISKERCISE",
"synonyms": [
"discus size",
"discuss I",
"Tisca size",
"Kiska size",
"discuss Eyes"
]
},
{
"key": "MFCJUNI",
"synonyms": [
"M F C Juni",
"MFC tunie",
"MFC tune",
"MFC Tu Ne"
]
},
{
"key": "SD STRESS",
"synonyms": [
"S D Stress",
"H D Stress",
"SD stress",
"HD stress",
"is distress",
"s distress",
"sdstress",
"SPSS",
"has De stress",
"FB status",
"HD stores",
"St stress"
]
},
{
"key": "POUNDIT",
"synonyms": [
"pound it",
"pundit",
"found it",
"foundit",
"pound rate",
"founded"
]
}
]
},
{
"name": "$MachineSchema",
"entities":[
{
"key": "HP LANE",
"synonyms": [
"HP lane",
"hp lane",
"hp line",
"h plane",
"hplane",
"hp name",
"HP rain",
"hp rain",
"HP name"
]
},
{
"key": "TPC-1001",
"synonyms": [
"tpc1001",
"tpc one thousand one",
"tpc 1001",
"tpc one thousand 1"
]
},
{
"key": "TPC-1002",
"synonyms": [
"tpc1002",
"tpc one thousand two",
"tpc 1002",
"tpc one thousand 2"
]
},
{
"key": "TPC-1003",
"synonyms": [
"tpc1003",
"tpc one thousand three",
"tpc 1003",
"tpc one thousand 3"
]
}
]
}
] }
答案 0 :(得分:0)
(从评论中提取答案以提高知名度)
您需要括号中的参数吗?没有括号可以没问题,或者在最后添加?会使它成为外卡。