Build Google Conversational Actions with Jovo and the Actions Builder

by Jan König on Oct 04, 2020

Tutorial: Build your first Google Conversational Action with Jovo

Learn how to use the new Google Conversational Actions Builder and Jovo to build Google Actions. This allows you to create apps for Google Assistant without the need to integrate with Dialogflow.

New to Jovo? Take a look at our GitHub repository (and leave a star if you like what we're doing)

Introduction

Difference between Google Actions with Dialogflow and Action Builder

Jovo has been offering support for Google Assistant since our launch more than 3 years ago. From the beginning on, we integrated with Google's natural language understanding service Dialogflow, the then standard way to build Google Actions. Although this already worked great (including support for additional integrations), our users had to create and configure a Dialogflow agent as an additional step.

Recently, Google introduced a new way to build apps for Google Assistant: Conversational Actions. This new release (including their Actions Builder graphical user interace) removed the necessity to connect with Dialogflow for natural language understanding.

In this tutorial, we will use Jovo to build a new Conversational Action for the Google Assistant platform. We will:

  • Create Google Action in the Actions Builder
  • Create a new Jovo project
  • Update the Google Action with the Jovo CLI
  • Run and test the Jovo code in the Google Action Simulator

Create Google Action in the Actions Builder

First, we will create a new Google Action project that we will then connect to our Jovo code in the next step. Learn more in the official documentation provided by Google.

Go to Actions Console and create a new project.

New Google Action Project

In the next step, select "Custom" as the type of Action you want to build:

Conversational Action Category

We will start with a fresh new project, so let's select "Blank" in the next step:

Conversational Action types

This opens the new Action Builder.

Google Action Builder

Feel free to click around a bit to get yourself acquainted with this new interface. There is no need to make any changes just now. We will later do this using the Jovo CLI.

Create and Run Jovo Code Project

In this section, we're going to connect a Jovo project (the source code running the conversations of our Google Action) with the newly created Google Action project.

The app will do the following:

  • HelloWorldIntent: Says "Hello World!" and asks the user for their name
  • MyNameIsIntent: Greets the user with their name

It's the same functionality that is also used in the Jovo Quickstart Guide.

Install Conversational Actions Jovo Template

First, install (or update to) the latest version of the Jovo CLI:

Next, we'll create a new Jovo project. The below command creates a new folder my-google-action and downloads a Jovo template called google-conversational-actions-helloworld. You can find the source code of the Google Conversational Actions template here.

We also specify the locale as en because the Google Action Builder doesn't use e.g. en-US which is used by other platforms like Alexa.

If you're unfamiliar with the Jovo project structure, take a look at the following items in our documentation:

Deploy Model to Actions Builder

We will use the Jovo Model to turn the language model defined in the models/en.json into a platform specific model for Google Conversational Actions.

We had to tweak our Jovo Hello World Template because the new Google Actions Builder does not provide a built-in entity type for first names. If you look at the models/en.json file, you can find that we created an input type called NameInputType that currently comes with 3 names (for demonstration purposes only):

If you want to use additional names for testing, add them to the document.

The Jovo CLI will then use this information to update the Google Action project in the Actions Console. To point it to the right project, update the projectId in the project.js file:

The project ID can be found in the project settings of the Actions Console:

Google Action Project Settings

As a next step, we can run the jovo build command to create platform specific files:

This will create a new platforms/googleAction folder that contains several folders and files, including:

  • actions folder with actions for each intent in your language model
  • custom folder with language model content and scenes
  • settings folder with invocation name, project ID (added from the project.js file)
  • webhooks folder with your Jovo Webhook URL for local development

The files in the platforms are now ready to be deployed to the Actions console.

Before we can do so, we need to install the gactions CLI as explained in the official Google documentation. Download it and then run the following command to connect with your Google account:

This will show a permission screen like the one below. Connect with the account your Google Action is managed by.

gactions CLI Permission

After this, we can finally use the jovo deploy command to push the new files to the Actions console.

The deployment process might show a few warnings like a missing privacy URL. The warnings are OK for now and can be addressed later.

After successful deployment, the content in the Action Builder looks different:

Updated Google Action Builder by Jovo CLI

Alright, let's get to testing.

Run and Test Code

The intents in the Action Builder are all connected to your Jovo Webhook URL.

You can start the local development server by using the following command:

Learn more in the local development section of the Jovo Docs.

You can then go to the "Test" tab in the Actions console and try it out:

Google Action Test Simulator

Any questions? You can reach us on Twitter, Slack, or the Jovo Community Forum.


Jan König

Co-founder at Jovo

Comments and Questions

Any specific questions? Just drop them below or join the Jovo Community Forum.

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.