В google assistant sdk как изменить встроенное намерение по умолчанию на наше собственное намерение - PullRequest
0 голосов
/ 26 декабря 2018

Как изменить это встроенное намерение по умолчанию "намерение": "action.devices.EXECUTE", в наше собственное настраиваемое намерение, такое как "намерение": "com.devices.xyzz"?какие изменения нужно сделать, чтобы получить пользовательское намерение для черты.Ниже приведены данные actions.json

  "actions": [
  {
    "name": "com.webos.actions.contentIntextManager",
    "availability": {
      "deviceClasses": [
        {
          "assistantSdkDevice": {}
        }
      ]
    },

    "intent": {
      "name": "com.webos.intents.contentIntextManager", 
      "parameters": [
        {
          "name": "number",
          "type": "SchemaOrg_Number"
        },
        {
          "name": "speed",
          "type": "Speed"
        }
      ],

      "trigger": { 
        "queryPatterns": [
          "run ($Speed:speed)? $SchemaOrg_Number:number times",
          "run $SchemaOrg_Number:number times ($Speed:speed)?"
        ]
      }
    },

    "fulfillment": {
      "staticFulfillment": {
        "templatedResponse": {
          "items": [
            {            
              "simpleResponse": {
                "textToSpeech": "Google Chrome run $number 
    times $speed than Mozilla Firefox"
              }
            },
            {   
              "deviceExecution": {
                "command": "com.webos.commands.contentIntextManager",
                "params": {
                  "speed": "$speed",
                  "number": "$number"
                }
              }
            }
          ]
        }
      }
    }

**Here is the response:OUTPUT**
    {
"provider": "googleassistant",
"response": {
    "deviceAction": {
        "requestId": "5c31721f-0000-2413-8295-f403043942f4",
        "inputs": [
            {
                "intent": "action.devices.EXECUTE",
                "payload": {
                    "commands": [
                        {
                            "execution": [
                                {
                                    "command": "com.webos.commands.Launch",
                                    "params": {
                                        "appName": "YOUTUBE",
                                        "launchParam": "",
                                        "appAction": ""
                                    }
                                }
                            ],
                            "devices": [
                                {
                                    "id": "my_webos"
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }
}

} {"provider": "googleassistant", "response": {"displayText": "Okay"}}

...