Integrating With GoogleAssistant
Objective:
This document will help you set up a dialog flow agent (agents are equivalent to Alexa skills), connect the agent to a configured skill in the Voiceworx portal, connect the Google Agent to the VoiceWorx skill and use the agent via voice interaction on Google Assistant app.
How it works?
Setup skill in Voiceworx.
Setup Agent in Dialog Flow.
Manage integrations in Assistant App (configure if app uses account linking, skill. invocation, publishing on google play store).
Integrate/connect agent with the Voiceworx skill.
Set up Skill in Voiceworx
Set up your skill in the Voiceworx platform. You can also import the following template and create an app using the given template. Please follow this document to create app from the given template. Note: You need to make a slight change in the publishing step
Setup Agent in DialogFlow (DF)
Google Dialogflow allows “Lifelike conversational AI state-of-art virtual agents”. VoiceWorx users can connect their apps built in VoiceWorx to agents in google assistant. After setting up the skill in VoiceWorx, users need to setup agent in Google Dialogflow. Please follow the following steps.
Sign in with your Google account
Click on “Create Agent”. Provide the Agent Name and Click on Create. The agent’s name cannot contain whitespaces. If you have an agent already, click on the drop down and select the agent.
Create Intent. On the left menu, click on Intents. On the resulting screen, click on “Create Intent”.
Provide the following details:
IntentName: GetProductInfoIntent (same as the intent name in VoiceWorx)
TrainingPhrase: Keyword to invoke the intent (same as utterance for the intent in VoiceWorx)
Action and Parameters: For intents that contain parameter (corresponding to Slots in VoiceWorx), Provide the parameter details. The parameter name shall be same as the slot name in VoiceWorx. Provide the entity type as @sys.any. You can select from the available entity types as per your parameter type or also create custom ones.
User can also set the prompt message for asking the user input for the parameter value. Click on the prompts section and provide prompt messages.
Scroll down to the “Fulfilment Section” and select “Enable webhook call for this intent”.
Click on Save.
Now to setup for webhook, on the left-navigation, click on Fulfillment. Enable the Webhook toggle and provide the URL to VoiceWorx.
Depending upon where your app is located in VoiceWorx, provide the following URLs.
Development/ Staging: https://channeltest.voiceworx.ai/api/v1/google
Production/ Live: https://channel.voiceworx.ai/api/v1/google
For testing the agent, use the try it now section.
Start with the training phrase you set up in step 6.b. i.e. find product
Provide the product name value as ‘apple watch’ after the agent asks for product name and you shall be able to get the following response.
The agent has been tested successfully.
Integrations
Depending upon whether the app in VoiceWorx requires account linking or not, you can set integrations on Google DialogFlow. For the purpose of this demo, we proceed with Integration without account linking.
Integration Without Account Linking
Click on Integrations menu, and then on “continue with Integrations” on the main screen.
On the resulting screen, ensure that “Sign in Required” is unchecked and click on Manage Assistant App.
Now to test the app, let’s link the assistant with VoiceWorx agent.
Connect Dialog Flow Agent with the Voiceworx Skill
Go to the Dialog Flow page, click on the gear icon as shown in the image and copy the project id in the resulting screen.
Go to the voiceworx platfrom, on the left navigation, click “Custom App” -> “Manage Apps” then hit the select button for the app you set up in the step 1. Then Click on the Publish tab.
If publish profile for ‘Google Assistant ’ channel is already set up, click on Edit and update the google Project Id.
Else, Add New Publish, and on the resulting dialog, make sure the Channel is set and “Google Assistant” and paste the Google Agent ID that was copied from the Dialog Flow screen to the “Google Project Id” text box
Click “Save”.
Test the DialogFlow Agent
On the integrations, click on “Continue with Integrations”, Click on Test on the resulting tab.
You will be redirected to the Google Actions Console. On the Test tab, enter Talk to Product Lookup. “Talk to Product Lookup” shall be auto generated.
Provide the training phrase set up in step 6.b. Then continue.
The successful dialog flow looks something like the screen shown above. The assistant is deriving results from its integration to the VoiceWorx App.
Integrate With Account Linking OAuth
For this step, you first need to gather the ClientId and Client Secret.
Get Credentials for Web Service:
Use the following steps below to setup your Client Id and Secret
On the navigation got to API & Services then select credentials
Download the json for the OAuth2 Client (Web Client) into a secure place and copy the ClientId, Secret, Token URL, Auth Url from the json file.
Note: Skip this step if you have followed the Setup without account linking step above.
Setup Account Linking
Click on integrations and select “Continue with Integrations” on the main screen.
Select Google Assistant and click Integration Settings in the GA Card, if the skill requires account linking select the Sign-In Required Option on the Welcome Intent.
Select the Manage assistant app to set up the OAuth
In the Manage Assistant APP console, select Develop -> Account Linking
In the Account linking screen use this options for the OAuth configuration
Account Creation -> Do you want to allow users to sign up for new accounts via voice? – NO
Linking type: OAuth, Authorization Code
OAuth Client Information
ClientId – From previous step
Client Secret – From previous step
Authorization URL- https://portal.voiceworx.ai/OAuthCode/Redirect
Token URL - https://portal.voiceworx.ai/OAuthCode/Token
Testing Instructions: Your VoiceWorx registered email.
You can now test the bot and you shall receive following output.
Publishing the Project
Click on “Integrations” in the side menu and select “Continue Integrations” in the resulting modal.
Click on “Manage Assistant App”
In the “Quick SetUp” section, click the “Decide How Your Action Is Invoked”
Set the Display name
Click on deploy.
Fill the following fields:
Description: Short and full description
Images: 2 images but only the small Logo image is compulsory. The large banner is optional. The large banner should be 1920 x 1080 px
Privacy and consent: Privacy is compulsory but terms and condition url is not compulsory
Contact details the developer email and name: email should be an active email
Additional information: fill all fields that apply
These fields are mandatory and the information provided here should reflect the assistant and your company. Missing out these fields might cause issues while trying to release the app.
Click Save
Go to Company Information and fill the following fields
Company Contact
Developer contact
Go to brand verification follow these instructions from google to verify your https://support.google.com/webmasters/answer/9008080?authuser=0&visit_id=637501983465305388-959464850&rd=1
Click on Release.
Select the Alpha Release tab in the resulting pane and click on “Manage Beta Testers”
Type in the email address of your beta testers click on the “+” sign and click save. Note: emails should be a valid google account
Click on “Save” then click on the back arrow button in front of the “Whitelist alpha testers” label to go back to the Manage Releases page
On the Manage releases page, click the “Create a release” button.
Note: its take between 30 minutes to 4 hrs to get a response on the release request, if there is any issue on the release request, the necessary information will be shown on this Google Actions console page.
Click on the “More info” to see the details of what needs to be fixed
Note: the privacy policy is a very common cause of google declining releases. It must conform to the following
The URL must link to a valid website containing a privacy policy specific to your Action.
It must be a public document that discloses how your Action collects, uses, and shares user data, including the types of parties it is shared with.
It must be available for Google crawlers to access and scan the content of the privacy document.
It must also be written in each of the languages for which your Action is enabled.
It must contain any of the following:
Action Name:
Company Email:
Developer Email:
Please see https://developers.google.com/assistant/console/policies/general-policies#user_data for more information.
Test the project
Launch Google Assistant on your mobile
Say “Hey Google talk to product lookup”
Last updated