我在使用Google Assistant SDK时遇到了问题(或者我听不懂) 我想创建自己的自定义操作并在python中管理这些操作,但是我创建的自定义操作不起作用,并且本机google操作效果很好(示例onOff效果很好“ com.example.commands.prova”)
这是我的自定义JSON操作文件
{
"manifest": {
"displayName": "Blinky light",
"invocationName": "Blinky light",
"category": "PRODUCTIVITY"
},
"locale": "it",
"actions": [
{
"name": "com.example.actions.prova",
"availability": {
"deviceClasses": [
{
"assistantSdkDevice": {}
}
]
},
"intent": {
"name": "com.example.intents.prova",
"trigger": {
"queryPatterns": [
"try now"
]
}
},
"fulfillment": {
"staticFulfillment": {
"templatedResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "ok test ok"
}
},
{
"deviceExecution": {
"command": "com.example.commands.prova"
}
}
]
}
}
}
}
]
}
这是python脚本
if (event.type == EventType.ON_CONVERSATION_TURN_FINISHED and
event.args and not event.args['with_follow_on_turn']):
if event.type == EventType.ON_DEVICE_ACTION:
for command, params in event.actions:
print('Do command', command, 'with params', str(params))
if command == "**com.example.commands.prova**":
print('Do command')
如果我说“立即尝试”在自定义操作中不起作用,就没有我的特质 如果我说“关闭”,则响应正确采用特征“ action.devices.commands.OnOff”
我如何进行自定义操作,例如使用打印机打印星号 (视频示例https://www.youtube.com/watch?v=rKf6CNJsaPM)