Once you build your agent on Dialogflow, you can use the one-click integrations to connect to various platforms such as google assistant, web, telephony, slack, facebook messenger, twitter and more. In this lab you will integrate Dialogflow with Actions on Google to enable the chatbot as a Google Action on Google Home or Assistant.

Actions on Google is a platform where you can create software to extend the functionality of Google Assistant. By integrating Dialogflow with Actions on Google you can reach over 500M devices that support Google Assistant, like smart speakers, phones, cars, TVs, watches, etc

What you'll learn

Prerequisites

We will use the same appointment scheduler chatbot that we build in the previous codelab and work through the integration.

  1. Navigate to Go to the Dialogflow Console.
  2. Select the AppointmentScheduler agent that we created in the previous codelab.

  1. Click on Integrations

  1. Click on "Google Assistant" integration settings

  1. In the pop up window, will define the explicit and implicit invocation:
  1. Explicit invocation occurs when a user tells the Google Assistant to use your Action by name. Optionally, the user can include an invocation phrase at the end of their invocation that will take them directly to the function they're requesting.
  1. Implicit invocation is an interaction flow that occurs when a user makes a request to perform some task without invoking an Action by name. The Google Assistant attempts to match the user's request to a suitable fulfillment, such as an Action, search result, or mobile app, then presents recommendations to the user. If you have deployed an Action that can help the user with their task, implicit invocation provides a way for users to discover your Action via the Assistant.

  1. Click on "Test", since we just developed our app, test is a good way to see if it functions correctly.
  1. Click on "TEST", this will open the simulator in Actions on Google console.

  1. Try a few phrases :
  1. "Talk to my test App". Bot replies: "Alright. Let's get the test version of my test app.Good day! What can I do for you today?"
  2. "help me set an appointment" or "set an appointment for 4pm tomorrow" and follow the prompts to see an appointment set up.

  1. You will see options on the right to test and debug the Display, Request, Response, Errors and logs.

  1. Navigate to Dialogflow console and click on integrations
  2. Then click on Action on Google integration again.
  3. In the pop up this time, let's explore "MANAGE ASSISTANT APP"

  1. This provides us the ability to set the invocation name for the chatbot, in the sample we have called it "Smart Scheduler", but you will need to use another name (accepts no digits or special characters in the field) since these are global.
  1. Here select male/female voice for assistant and Click Save.
  2. Going back to overview - We have already built our application and it is ready to test.

  1. When you are ready for deployment, click on the Deploy tab on the left and provide company details and appropriate contacts.

  1. Next, under Deploy in the left menu, click on Directory Information, make sure you have provided a description for your application and sample invocations - for example here we have added "Talk to smart scheduler." It also requires one small and one big logo image (at least 192 pixels wide and tall), contact details, privacy information and a category. Click Save.

Sample small image that you can use:

  1. Next, under Deploy -> Location targeting, select the countries you want to deploy in and the surfaces you want your actions to run on.

  1. [Optional] Once you feel comfortable after simulator testing, you can choose to push the application for Alpha and Beta testers to further test. To enable Alpha and Beta testing, navigate to "Deploy" and click on "Release".
  1. With Beta launch you can test the action with 200 users.
  2. With Alpha release you can enable the action for up to 20 users without submitting for review.

  1. [Optional] When you are satisfied and reach to push the application to production, use can use the "SUBMIT FOR PRODUCTION" button under "Deploy"-> "Release" to submit to production.

  1. [Optional] You will be presented with a Dialog to confirm that you have tested this application before deploying to production and submitting for approval. Select appropriately. If you do not wish to submit the action for review in production that is fine, all the set up you did so far is still useful to do a proper testing in Simulator, Alpha and Beta.

At this point, log into you Google Home device or Google Assistant App with the same email address as the one you used to build this application.

Test it with the following conversation:

  1. Talk to <example name given> (smart scheduler in our case)
  2. Sure. Let's get the test version of smart scheduler demo.Hi! How are you doing?
  3. User: "Hi"
  4. User: "Set an appointment"
  5. Chatbot response: "What date?"
  6. User: "May 23"
  7. Chatbot response: "What time would you like to come in?"
  8. User: "10am"
  9. Also, try another example: "set an appointment for 4pm tomorrow". Google Home or Assistant should respond back with the confirmation of the appointment.

If you are planning on doing the other labs in this series, don't do the cleanup now, do it after you are done with all the labs in the series.

Delete the Dialogflow Agent

You built a chatbot created a google action out of it. You're now a chatbot developer!

Check out these other resources: