google action package how to define custom slot types?

廉价感情. 提交于 2019-12-12 19:42:24

问题


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


回答1:


I got it after two days more trying and reading.

At first I forgot one dollar sign. Secondly user defined intents in action.json package are only working as start trigger.

And with a larger set of names it seems like this types dont change anything at the Speech to text model.

So dtrange names like "Moreton Bay" is still not correctly recognized when its in the type field. And need to be figured out with very difficult Text parsing later.




回答2:


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



来源:https://stackoverflow.com/questions/46914224/google-action-package-how-to-define-custom-slot-types

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!