[英]Can't trigger custom actions on google assistant sdk
按照-https: //developers.google.com/assistant/sdk/guides/service/python/中给出的所有步骤进行操作之后,我就可以设置Google助手SDK并可以运行示例闪烁LED代码。 但是,当我尝试添加自己的自定义操作时,助手无法检测到我希望它识别的查询。 下面是我使用的代码。 我想念什么?
{
"manifest": {
"displayName": "Start Something",
"invocationName": "Start Something",
"category": "PRODUCTIVITY"
},
"actions": [
{
"name": "com.example.actions.StartSomething",
"availability": {
"deviceClasses": [
{
"assistantSdkDevice": {}
}
]
},
"intent": {
"name": "com.example.intents.StartSomething",
"parameters": [
{
"name": "actname",
"type" : "SchemaOrg_Text"
}
],
"trigger": {
"queryPatterns": [
"start ($SchemaOrg_Text:actname)?",
"start this ($SchemaOrg_Text:actname)? online"
]
}
},
"fulfillment": {
"staticFulfillment": {
"templatedResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Starting $actname online"
}
},
{
"deviceExecution": {
"command": "com.example.commands.StartSomething",
"params": {
"testname": "$actname"
}
}
}
]
}
}
}
}
],
"types": [
{
"name": "$actname",
"entities": [
{
"key": "games",
"synonyms": [
"fun",
"time killer"
]
}
]
}
]
}
问题是您要声明actname是文本模式类型,触发不支持该类型。 相反,您需要使用单独的类型,并在底部进行声明。 您应该更改参数的类型,如文档示例中所示 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.