This Christmas we received a Google Home Mini and this kind of present triggers the mind for new combinations.
So I decided to figure out if the Google Assistant could talk to our existing chat bot build with the Watson Conversation Service.
This can not be done directly, but with a man in the middle, in this case IBM Cloud Functions (OpenWhisk), it seems to work.
When you don't how to get started or you get stuck, just ask on StackOverflow, like I did: https://stackoverflow.com/questions/48115757/how-to-wrap-an-existing-chatbot-for-google-assistant-google-home
Extending Google Assistant is done by implementation Actions: https://developers.google.com/actions/extending-the-assistant
For this type of extension you need to use the Actions SDK: https://developers.google.com/actions/sdk/ and the main part of this SDK is the
Since we already have a chat bot that understands intents and entities, we can keep this simple by passing everything on to our fulfillment service, so the JSON looks like this
"description": "Default Welcome Intent",
"url": "https://openwhisk.ng.bluemix.net/api/v1/web/<Your IBM Cloud Function Endpoint>"
Whit this action.json, update the Google Action project from the command line like this:
gactions update --action_package action.json --project talktoeoffice
IBM Cloud Functions
We used IBM's Serverless environment called Cloud Functions to act as the man in the middle.
The cloud function, also called actions, parses the JSON that the Google Assistant sends and invokes the Conversation Service
The response to the Google Assistant needs to be in a specific JSON format, see https://developers.google.com/actions/reference/rest/Shared.Types/AppResponse
The key is to store/exchange the context between the services.
When you store the Watson context in the conversationToken property of the response to the GoogleAssistant, you get this back from the Google Assistant in the next part of the conversation.
Watson Conversation Service
the Watson Conversation Service can be used as is as long as you stick to text based chatting. Support for screens (where you can display buttons and pictures) is something for the next iteration.
Below a screenshot to for side-by-side comparison
As you can see from the screenshot, we started in Dutch, we have a few more steps to take in English before we can publish the Google Assistant so that we can all try out on our smartphones and/or homes.
I will update this item when this is the case.