Make google actions development project preview persist longer

前端 未结 3 1078
梦谈多话
梦谈多话 2020-12-04 13:24

I want to make google voice actions app for my Google Home. But, based on quick research, as of Dec 11, google does not allow private projects for Google Home.

Refer

3条回答
  •  孤城傲影
    2020-12-04 14:06

    As of today, May 17 2017, the highest voted answer to this question no longer works for new API.ai projects due to the upgrading of the Actions on Google SDK to v2. A similar methodology to @Brady's answer does work still, but they've made it more difficult in some ways (more information needs to be provided to Google, globally unique invocation name despite being a local only test), and better in others (gactions CLI docs now explicitly state that indefinitely timed previews are accepted, and actually is the default if not provided as a argument to the gactions test call).

    1. Create your API.ai agent as normal.
    2. Under the "Integrations" side menu, open the "Actions on Google" settings.
    3. Select "Test" from the bottom of the dialog box that appears (you may need to jump through a few hoops here, signing in, authorizing account access, etc.)
    4. This is where it gets a little different. You now need to create a project on the Actions on Google console. Create or import a project to the console.
    5. The first required step is to supply an action package, which can come from either API.ai or the SDK directly. For API.ai, you have to go back to the Integrations page we were at and press "Update" on your Actions on Google settings. (On the previous version of the SDK, this was labeled "Deploy" and would have made your app public, but don't worry - all this does now is update the AoG console. You publish publicly from the AoG console later if desired).
    6. This new console requires more information outright than was necessary before. I found that the "Assistant app name" can be whatever you want, but the "Pronunciation" is strictly limited to a few conditions (globally unique, reserved keywords, non-brand violating). I also found that I could still invoke using the app name and not just the pronunciation, but I suspect that will be fixed.
    7. Once you've filled out all the necessary information, you can test from API.ai. Return to the AoG settings menu in API.ai and retrieve the response content from the HTTP request preview (just like in @Brady's answer above). Here we hit another difference. The content of the request response can't be used directly in the action.json file as it is wrapped in another object. You want to use only the object from the property actionPackage. (i.e. remove

      {
        "actionPackage": 
      

      from the beginning of the content and

      }
      

      from the end). You should end up with a object of a structure similar to this (but maybe not exactly, it depends on the content of your API.ai agent):

      {
        "actions": [...],
        "types": [...],
        "manifest": {...},
        "conversations": {...}
      }
      
    8. Put this into your action.json file.

    9. Execute the new gactions CLI command:

      gactions test --project  --action-package action.json
      
    10. Enjoy your local v2 Actions on Google SDK project! And pray Google does not alter the deal any further...

    I tried my best to recall what I had to do from memory, so there may be some mistakes in this write up. Hopefully this helps someone.

提交回复
热议问题