Oracle Digital Assistant Techexchange

Oracle Digital Assistant Techexchange

Oracle Digital Assistant TechExchange Article. How to Build a Webhook to Connect Your Oracle Digital Assistant Chatbot to Google Home Michael Wootton, June 2019 Let's assume you built a chatbot using Oracle Digital Assistant and you've exposed it on various messengers and Alexa too. A next step then could be to connect your chatbot to Google Home. I die research this topic quite a lot but couldn't find anything complete describing how to do this using Google Actions on Google API version 2. So, what has started as a research, eventually has become an opportunity for me to write a comprehensive guide to integrate Oracle Digital Assistant with Google Home. Following this article, you learn how to build a webhook, how to create an Action on Google, how to create a channel in Oracle Digital Assistant and how to use Goggle sign-in (account linking) to access user information from Google. Note that because I live in Brazil, a requirement was to build chatbots in more than one language (English, Spanish and Portuguese). Therefore I built the webhook to be able to call two different channels, each calling a different language optimized skill. 1 Oracle Digital Assistant – TechExchange BACKGROUND ......................................................................................................................................................... 3 1. CREATE GOOGLE HOME – ACTIONS ON GOOGLE ................................................................................... 3 1.1. CREATE ACTIONS ON GOOGLE ACCOUNT ....................................................................................................... 3 1.2. CREATE ACTIONS FOR YOUR GOOGLE PROJECT ............................................................................................ 4 1.3. Project Details – Setup ............................................................................................................................ 6 1.4. DIALOGFLOW ................................................................................................................................................ 8 1.4.1. Update “Default Welcome Intent” ......................................................................................................... 8 1.4.2. Update “Default Fallback Intent” ......................................................................................................... 10 1.4.3. Create a “SIGN_IN” Intent .................................................................................................................. 12 1.4.4. Create “Cancel” Intent ........................................................................................................................ 13 1.4.5. Define Fulfillment ................................................................................................................................ 15 1.4.6. Execute Integrations ........................................................................................................................... 16 1.4.7. Adding More Languages ..................................................................................................................... 19 1.5. BACK TO ACTIONS ON GOOGLE - DIALOGFLOW ............................................................................................. 21 1.5.1. Update Invocation ............................................................................................................................... 21 1.5.2. Setup Account Linking ........................................................................................................................ 21 2. CREATE YOUR CHANNELS IN ODA ........................................................................................................... 22 2.1. CREATE NEW CHANNELS IN ODA ................................................................................................................. 22 3. UNDERSTANDING THE WEBHOOK CODE................................................................................................. 23 3.1. EXPLAINING BY LINE RANGES: ...................................................................................................................... 23 3.1.1. Line 10 ................................................................................................................................................ 23 3.1.2. Line 21 to 58 ....................................................................................................................................... 23 3.1.3. Line 65 to 77 ....................................................................................................................................... 24 3.1.4. Line 78 to 116 ..................................................................................................................................... 25 3.1.5. Line 118 to 210 ................................................................................................................................... 28 3.1.6. Line 255 to 327 ................................................................................................................................... 31 3.1.7. Line 330 to 414 ................................................................................................................................... 31 3.1.8. Line 417 to 419 ................................................................................................................................... 32 3.1.9. If you only have on Chatbot ................................................................................................................ 32 4. CONCLUSION. ............................................................................................................................................... 32 Oracle Digital Assistant - TechExchange 2 Background Google Home supports multiple languages, including English, Spanish and Portuguese. Therefore, Google Home was my option of choice for building a chatbot that presents information from my SaaS (EPM EPBCS) in Portuguese. However, I also needed support for Spanish (for LAD) and English. For this, I needed to create a webhook that could connect to two chatbots I built using Oracle Digital Assistant. Note: I created two chatbots, one for Spanish and another to handle Portuguese and English. It was my first experience in building chatbots and today I know that I could have used a single chatbot supporting multiple languages using resource bundles for Portuguese, Spanish and English. However, the approach I took is not wrong at all, just another implementation of multi-language support. In this tutorial I am going to show you how you create a webhook that works with Google Home and that uses account linking to get user information (Google user id, email, user name) form the user's Google accounts. Note: If you simply connect to Google Home, the user Id you get is a generated random identifier. So each user – bot session uses its own user Id, making it difficult to save user information for later use. In my case I created a chatbot that can connect to any EPBCS Instance so at first connection I ask for the EPM server it will connect and also for the user name for future use if the chatbot is approached by the same user. For this I needed a user Id that does not change. Below are the individual steps covered in this article 1. Create Google Home – Actions on Google 2. Create your Channels in Oracle Digital Assistant 3. Understanding the webhook Code 1. Create Google Home – Actions on Google You use Actions on Google to create skills, intents and the webhook connection. Actions can use the following options to connect to external services: Actions SDK and Dialogflow. For this article I decided to Dialogflow. 1.1. Create Actions on Google Account • You must have a Gmail account for creating Actions on Google. • Navigate to https://developers.google.com/actions/ • Click on the “Sign In" link on the top right and authenticate with your Google credentials Oracle Digital Assistant - TechExchange 3 • After successful login, click the GO TO GOOGLE ACTIONS CONSOLE link on the top right (as shown in the image below). 1.2. Create Actions for Your Google Project • In the Console page, click on + Add/Import Project to create your new Actions on Google Skill Oracle Digital Assistant - TechExchange 4 • In the pop-up window titled “New Project”: • Provide a project name, like planning in my case. • Choose a language for the Skill. Note that you can add other languages later. • Choose a country or region. I, for example, chose Brazil. • Click on Create Project (as shown in the image below) • Next, you will see a Welcome to your New Project Screen. Use this screen to choose the Google Actions template to build with. • I chose: "Conversational – Build a customized conversational experience”. This option uses the Dialogflow option. Oracle Digital Assistant - TechExchange 5 • Choosing a template creates the skill and navigates you to the Actions on Google page for your Action ("planning" in my example). The name of the Action is displayed on the top right of the page next to the “Actions on Google” title. 1.3. Project Details – Setup In this section you will: • Set the Google Home invocation name for your Actions • Define the Intents (Actions) to use • Select functionality used by an Action • Google sign-in (Account Linking) • Use of Webhook • Phrases to associate with your Actions • Test your Action on Google in the different languages • Configure the Webhook endpoint Oracle Digital Assistant - TechExchange 6 Note: The steps listed below

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    32 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us