Skip to content

Latest commit

 

History

History
 
 

GoogleAssistantConnector

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Google Assistant Proxy

here for Spanish document

By installing and configuring this proxy service, we can interact with our Bot Framework from Google Assistant

For this, we have to create a project in Action on Google that points to our proxy service. This in turn, will communicate with your bot using Direct Line.

Note: If you are not familiar with Actions on Google,I recommend you try these labs.

Quick guide

1. Download the code and compile the solution

solution in Visual Studio

if you can´t open the projects correctly, it means you don´t have the components installed development of Node.js.

Node.js component in the installer of Visual Studio

2. Publish the project GoogleAssitantProxy.

You can also test the project locally using ngrok. I show you how here.

Once you´ve tried the solution, I recommend you integrate it into your solution and deploy it together using DevOps.

3. Configure settings

Add setting DIRECT_LINE_SECRET with the secret key from the Direct Line channel of your bot.

Make sure that the Node version is at least 7.10.1 (in Azure through setting WEBSITE_NODE_DEFAULT_VERSION)

I show you how here

4. Configure templates actions.json

Update templates form GoogleAction with url from your GoogleAssitantProxy. (a template for each language that supports our bot).

in the Deployment folder there are two example templates (one for English and the other for Spanish).

{
 "locale": "es",
 "actions": [{
     "description": "<description>",
     "name": "MAIN",
     "fulfillment": {
         "conversationName": "MAIN_CONVERSATION"
     },
     "intent": {
         "name": "actions.intent.MAIN",
       "trigger": {
         "queryPatterns": [ "Speak with <name of your bot>", "Hi <name of your bot>", "I want to speak to<name of your bot>"]
         }
     }
 }],
 "conversations": {
   "MAIN_CONVERSATION": {
     "name": "MAIN_CONVERSATION",
     "url": "<url-of-your-deployment-GoogleAssitantProxy>",
     "inDialogIntents": [
       {
         "name": "actions.intent.CANCEL"
       }
     ],
     "fulfillmentApiVersion": 2
   }
 }
}

5. Update your project Actions for Google

  • Update in the script GoogleActionDeploy.cmd your porject identifier Actions for Google

    gactions update --project PROJECTID --action_package action.es.json --action_package action.en.json
    
  • Run script GoogleActionsDeploy (if it´s the first time you´ve done it, you need to authenticate it with your Google account).

    This script uses gactions CLI, which is the command line tool to update the projects of Actions on Google. More information here.

    To obtain the identifier of the project. In the console Actions on Google of your project, Settings (the nut), Project ID. Actions on Google settings Actions on Google project

6. Check if it works

Test in the simulator of the console of 'Actions for Google' and see if it responds.

You can see the console in Azure in Advanced Tools, Log streaming

Azure AdvancedTools Azure Kudu

7. Configure GoogleAssitantProxy

Now that we have configured all the infrastructure, we will now configure our proxy to better adapt it to our bot.

  • Welcome messages, etc. here
  • Other possible settings. here

Recognition

Many thanks to Capgemini for the very impressive work they have carried out here. This code was inspired by their work.

To @juliapiedrahita for starting this project and making the work easier.

By Alberto Fraj (@alfraso).