address. Gaston Geenslaan 11 B4,ย 3001 Leuven
All Insights

Integrate your Oswald chatbot with Google Assistant & Google Home

This week, we released an update to Oswald that was all about integrations. Today, I want to guide you through one specific integration: Google Assistant.

Written by
Michiel Vandendriessche
Founder Raccoons

This week, we released an update to Oswald that was all about integrations (read about it in our previous blog). Today, I want to guide you through one specific integration: Google Assistant.

What is Google Assistant?

Google Assistant is the voice assistant of Google. With Google's experience with natural language processing and search, it's probably the smartest voice assistant available on the market. It has three main features:

  • Available on many platforms
  • Available in many languages
  • Possible to integrate your own chatbots
Google Home Mini featuring Google Assistant
A Google Home Mini featuring Google Assistant

Available on many platforms

Google Assistant is natively available on mobile devices, like Android smartphones, or through a mobile application for iPhones. That's nice, but it doesn't stop there. It is available on smart speakers, like the complete collection of Google Home devices, but also third-party speakers like the Sonos One (at this moment only available for selected test users). And there are even more ways to talk to Google Assistant, like headphones (Google Pixel Buds, Bose QuietComfort 35 II and many more), watches, TV's, cars... We can conclude with the fact that many users might already have access to Google Assistant.

Available in many languages

One of the main reasons we started with Google Assistant as the first voice assistant integration for Oswald, was its support for the Dutch ๐Ÿ‡ง๐Ÿ‡ช language. But there are many more languages like Danish ๐Ÿ‡ฉ๐Ÿ‡ฐ, English ๐Ÿ‡บ๐Ÿ‡ธ, French ๐Ÿ‡ซ๐Ÿ‡ท, German ๐Ÿ‡ฉ๐Ÿ‡ช, Hindi ๐Ÿ‡ฎ๐Ÿ‡ณ, Italian ๐Ÿ‡ฎ๐Ÿ‡น, Japanese ๐Ÿ‡ฏ๐Ÿ‡ต, Korean ๐Ÿ‡ฐ๐Ÿ‡ท, Norwegian ๐Ÿ‡ณ๐Ÿ‡ด, Portuguese ๐Ÿ‡ง๐Ÿ‡ท, Spanish ๐Ÿ‡ช๐Ÿ‡ธ and Swedish ๐Ÿ‡ธ๐Ÿ‡ช.

Possible to integrate your own chatbots

As an admirer of all Apple products and services and a heavy Siri user, this feels a little bit achy to write. The main problem with Siri is that it doesn't integrate well with third-party applications. Yes, some applications already have a Siri integration, but it's very limited compared to what Google and Amazon offer developers as a development platform for respectively Assistant and Alexa. Alexa offers 'Alexa Skills' to developers, Google offers 'Google Actions'. These are development platforms to create your own chatbots, using the tools you want, and make them available through Alexa and Assistant. You basically only use the platform (and the devices), the speech to text and the text to speech from Google Assistant. Everything else is handled by your favourite chatbot platform. Of course, you will be using Oswald as chatbot platform, because of its easy to use interface and many extra features ๐Ÿ˜‰

Let's create a voice assistant

First of all, you need to create a chatbot, called "Frank The Weather Chatbot" (Belgians are going to get it ๐Ÿ˜ƒ) using Oswald. In this blog, I'm not going to cover all Oswald features and methodologies. I already created a simple chatbot that knows all about the weather. It has the following intents:

  • Clouds: ask about the cloud cover in a city
  • Temperature: ask about the temperature in a city
  • Weather info: ask about the weather in a city
  • Wind: ask about the wind in a city
  • Sun: ask about sunrise and sunset in a city

I uploaded a list of cities in the world as a 'city' entity in Oswald.

In every scenario, I created an advanced code response connecting to the Openweathermap API. Take a look at an example of such an advanced code response:

from responses.responsemessage import ResponseMessage
from responses.responsetype import ResponseType
from responses.responsedata import ResponseData
from responses.response import Response
import json
import requests

class WeatherInfo(Response):

baseUri = ""
appId = "XXX"
lang = "en"
units = "metric"

def getResponse(self, sentence, context, options={}):
cities = sentence.getEntitiesWithLabel("city")
if len(cities) == 0:
cities = context.getEntitiesWithLabel("city")
city = cities[0].value
params = {
"lang": self.lang,
"units": self.units,
"appid": self.appId
r = requests.get("{}weather?q={}".format(self.baseUri, city), params=params)
weatherInfo = json.loads(r.content)
description = weatherInfo["weather"][0]["description"]
return ResponseMessage(
message="There is currently {} in {}.".format(description, city.title()),

Now take a look at a conversation with the chatbot. Note the context sensitivity and the new 'test your chatbot in your own webpage' feature ๐Ÿ˜‰

Connect to Google Assistant

Okay, that was a little introduction to my demo chatbot. Now let's start with the real interesting part: the Google Assistant integration.

First of all, we're going to click on 'Integrations' in the left menu and add Google Actions as a new integration.

Oswald integrations

You now see some steps to configure the configuration. Don't worry I will guide you through it.

Google Actions integrations page

First, we're going to log in to the Google Actions console and create a new project.

A new Google Actions project in the Google Actions console

Now we're going to the bottom of the page and click on the 'Conversational' card.

Project overview of the Google Actions project

That was part one! Now we're going to download the Google Actions command line interface. Now, I'm going to create a directory on my local machine with this Google Actions CLI file. Then, I'm going to cd into that directory and run the following commands:

mv gactions.dms gactions
chmod +x gactions

The first command is because I don't like the .dms extension ๐Ÿค“ The second line is to make the gactions file executable. Next, we go to the integrations page and we click the 'Download an actions.json file per language' button. It downloads an actions file per language we defined for the chatbot. In this case, we're only going to implement the English language. When the file is downloaded, we're going to add it to our local directory. Then, we're going to add it to our Google Actions project. We need our Google Actions project ID. You can find it in the Google Actions project settings page. For me, the Project ID is 'frank-the-weather-chatbot'.

The project settings of the Google Actions project

Okay, it's time to run cd into our local directory and run the following command.

./gactions update --action_package actions.en-US.json --project frank-the-weather-chatbot

We get this response:

Gactions needs access to your Google account. Please copy & paste the URL below into a web browser and follow the instructions there. Then copy and paste the authorization code from the browser back here.
Visit this URL:
Enter authorization code:

Easy enough, copy/paste the URL in your browser, log in to your Google account and copy the authorization code. Paste the authorization code in your terminal and hit the return key!

When we go to the Actions page in the Google Actions console, we see there is a new actions.intent.MAIN action for the English language.

Actions overview of the Google Actions project

That's it! Weโ€™ve successfully integrated our Frank The Weather Chatbot with Google Assistant. Now let's activate the Google Actions integration in Oswald by activating the toggle.

Google Actions integrations page

Then, we're going to try the Google Actions simulator.

Google Assistant simulator

Cool, right? Once the connection is made, you can make any changes you like to the Oswald chatbot. Once you publish your changes, your Google Assistant chatbot automatically gets updated. And it gets even beter! Because I have a Google Home Mini, which is logged in to the same Google Account, I can test my Oswald chatbot using my Google Home. Watch the video below to see the results!

A Google Home Mini demo with an Oswald chatbot
Written by
Michiel Vandendriessche
Founder Raccoons

Subscribe to our newsletter

Raccoons NV (Craftworkz NV, Oswald AI NV, Brainjar NV, Wheelhouse NV, TPO Agency NV and Edgise NV are all part of Raccoons) is committed to protecting and respecting your privacy, and weโ€™ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please tick below:

By submitting this form, you agree to our privacy policy.

In order to provide you the content requested, we need to store and process your personal data. If you consent to us storing your personal data for this purpose, please tick the checkbox below.

More blog articles that can inspire you


Data scientists, time to negotiate with your boss! Should you upgrade to Appleโ€™s M2 Pro or Max?

At Brainjar, we are real Apple fans. Most of us use a MacBook Pro, and when Apple released the new MacBooks with upgrade...

what we do


address. Gaston Geenslaan 11 B4,ย 3001 Leuven