Google Assistant as an inbound channel
To create an Action and deploy the bot into it, please follow these steps:
- Create a Google Assistant channel.
- Download Action Package.
- Register your Action in the Actions Console.
- Create an activation phrase.
- Copy the Project ID.
- Download gactions.
- Upload the Action Package into your project.
- Test your bot in the Actions Console simulator.
Create a channel
Click the Channels tab on the side panel, then click Inbound → Connect channel. Choose Google Assistant.
Fill in the fields:
- Channel name — choose any name you like. You can change it later.
- Web app URL — specify the link to Interactive Canvas web application.
- Branch — specify the project branch you want to deploy into the channel (
master
by default). You can also select a Git tag or enter a specific commit hash. - Deployment — select Automatic (whenever any change made to the project is saved) or Manual (using the Deploy button in the channel description line).
- Add trigger — here you can add the phrases that will be associated with your action. If the user says one of these phrases, Google Assistant will suggest activating your action.
Click Create. Wait for a pop-up window with the deploy result to appear.
Action Package
Download the JSON from your Action Package. To do that, click the link Download action.json under the name of the newly added channel.
Action registration
Proceed to Action Console and create a new project. To do that, click Add/import Project. Set the name of the project, the language and your country. Choose a category and a subcategory from the suggested options.
Activation phrase
After you choose a category, you will see an admin panel. Click Setup → Invocation. In the Display name field set the activation phrase.
Here you can also choose the voice that the bot will use to talk to users. Save the changes
Project ID
Click the Gear icon and proceed to the Project settings to copy Project ID.
gactions
Download the gactions software for your OS. You don’t need to execute this file, just proceed to the next step.
Upload the Action Package into your project
Open the Command Prompt (for Windows) or terminal (macOS, Linux). Proceed to the folder containing your gations and the JSON-file for the Action Package. Run this command:
gactions update --action_package PACKAGE_NAME --project PROJECT_ID
Use the name of the JSON-file instead of PACKAGE_NAME
here. Use your Project ID
that you have copied previously instead of PROJECT_ID. Click Enter
.
You will be asked to authorized. Open the suggested url, copy the authorization code and paste it into the command prompt or terminal.
Test it
Now you can test the Action using the device supporting Google Assistant in the same account that you used to create the project. You can also test your bot in the Action Console simulator (you can find it in the Actions console).
Before testing, check the permissions for activity controls. To do that, proceed to your Google account → Privacy & personalization → Manage your data & personalization → Activity controls.
The following settings should be turned on:
- Web & App Activity;
- Device Information;
- Voice & Audio Activity.