Search code examples
actions-on-googlegoogle-home

google action package how to define custom slot types?


Hi this is a question about: google home, action sdk, gactions.exe

at https://developers.google.com/actions/reference/rest/Shared.Types/QueryPatterns Are so called query pattern with custom types but when I try to add them to my action.json and than update via gaction it always says customTypes is an unknown Parameter.

Does someone have an working example with ApiVersion: 2 ?

Is there somewhere in general an larger example of this json. To better see how all works together? After 2 hours research I cant find anything.

Thanks and best regards

Update: EDIT that works BUT only as intent to start the Skill/APP not inside the APP

Its Still not change the Speech to text.

edit: that work:

 {
      "actions": [
        {
          "description": "Default Welcome Intent",
          "name": "MAIN",
          "fulfillment": {
            "conversationName": "cloud fleet manager"
          },
          "intent": {
            "name": "actions.intent.MAIN",
            "trigger": {
              "queryPatterns": [
                "talk to cloud fleet manager",
                "welcome at cloud fleet manager",
                "ask cloud fleet manager"
              ]
            }
          }
        },
        {
          "description": "first text Intent",
          "name": "hallo2",
          "fulfillment": {
            "conversationName": "cloud fleet manager"
          },
          "intent": {
            "name": "com.cfm.hallo2",
            "trigger": {
              "queryPatterns": [
                "(hello)? to cloud fleet manager",
                "hallo $Test:text cloud fleet manager"
              ]
            },
            "parameters": [
              {
                "name": "text",
                "type": "Test"
              }
            ]
          }
        }
      ],
      "types": [
        {
          "name": "$Test",
          "entities": [
            {
              "key": "bmw",
              "synonyms": [
                "B M W"
              ]
            },
            {
              "key": "benz",
              "synonyms": [
                "benz"
              ]
            }
          ],
          "isUserDefined": false
        }
      ],
      "conversations": {
        "cloud fleet manager": {
          "name": "cloud fleet manager",
          "url": "https://a69fa73a.ngrok.io/google",
          "fulfillmentApiVersion": 2
        }
      }
    }

https://drive.google.com/drive/folders/0B8G3pDr3aWiwZjU1akREdTZNQ1U


Solution

  • If you have custom slots like names of People or Ships.

    To get Custom Words like names. Correctly matched I found that the adding of speech bias hints is working quite well.

    You can find informations here:

    https://developers.google.com/actions/reference/rest/Shared.Types/AppResponse#Suggestion