Once you build your agent on Dialogflow, you can use the one-click integrations to connect to various platforms such as the Google Assistant, web, telephony, Slack, Facebook Messenger, Twitter, and more. In this codelab, you'll integrate Dialogflow with Actions on Google to enable the chatbot as an Action on Google Home or the Assistant.
Actions on Google is a platform where you can create software to extend the functionality of the Assistant. By integrating Dialogflow with Actions on Google, you can reach more than 500 million devices that support the Assistant, including smart speakers, phones, cars, TVs, and watches.
Before proceeding, you need to complete Build an appointment scheduler with Dialogflow.
What you'll learn
- How to enable an Actions on Google integration from Dialogflow
- How to test the Action
- How to manage the Assistant from the Actions on Google console
What you'll build
- An integration between a Dialogflow agent and Actions on Google
What you'll need
- A web browser and an email address to log into Dialogflow console
- Navigate to the Dialogflow console.
- Select the AppointmentScheduler agent that you previously built.
- Click Integrations.
- Click Google Assistant Integration Settings.
- In the dialog, define the Explicit invocation and Implicit invocation.
An explicit invocation occurs when users tell the Assistant to use your Action by name. Optionally, users can include an invocation phrase at the end of the invocation that leads directly to the requested function. When users say, "Ok Google, talk to smart scheduler," smart scheduler is the trigger name. In your case, the default welcome intent is a perfect spot for users to land on, so you'll stick with it.
An implicit invocation is an interaction flow that occurs when users make requests to perform a task without invoking an Action by name. The Assistant attempts to match the request to a suitable fulfillment, such as an Action, search result, or mobile app, then presents recommendations. If you've deployed an Action that can help users with the task, then implicit invocation provides a way for users to discover your Action via the Assistant. If users say, "Ok Google, ask smart scheduler to set an appointment for 5 PM tomorrow," that's an implicit invocation required to trigger a deep link, so in this case, you should invoke your schedule appointment intent directly because you know exactly what the users intend to do.
- Click Test to see if it functions correctly in the Actions simulator.
- Try the following phrases:
- Enter "Talk to my test app," to which the bot replies, "Alright. Let's get the test version of my test app. Good day! What can I do for you today?"
- Enter "help me set an appointment" or "set an appointment for 4 PM tomorrow" and follow the prompts to see an appointment setup.
- You can also see options to test and debug the request using the Display, Request, Response, Audio, Debug, and Errors tabs.
- Navigate to Dialogflow and click Integrations.
- Click Integration Settings for Google Assistant.
- In the dialog, click Manage Assistant App .
That provides you with the ability to set the invocation name for the chatbot. In the sample, you called it "Smart Scheduler," but you'll need to use another name because those are global.
- Select Male 1 voice for the Assistant and click Save.
5. Under Deploy, click Company Details, then provide company details and contacts.
- Click Directory Information. Complete all fields. Click Save.
Here's a sample small image that you can use:
- Click Location targeting, select the countries that you want to deploy to and the surfaces that you want your actions to run on.
- (Optional.) Once you feel comfortable after simulator testing, you can push the app for alpha and beta testers to further test. To enable alpha and beta testing, click Deploy > Release.
- With Beta, you can test the action with 200 users.
- With Alpha, you can enable the action for as many as 20 users.
- (Optional.) When you're satisfied and ready to push the app to production, click Deploy > Release > Submit For Production.
- (Optional.) You'll see a dialog to confirm that you tested the app before deploying to production and submitting for approval. Select appropriately.
If you don't wish to submit the action for review in production, that's fine. All the setup that you did so far is still useful to do a proper testing in simulator, alpha, and beta.
Log into Google Home or the Assistant app with the same email address that you used to build the app. Test it with the following conversation:
- User: "Talk to <example name given> (smart scheduler in your case)"
- Chatbot: "Sure. Let's get the test version of smart scheduler demo. Hi! How are you doing?"
- User: "Hi"
- User: "Set an appointment"
- Chatbot: "What date?"
- User: "May 23"
- Chatbot: "What time would you like to come in?"
- User: "10 AM"
Try another example in which you set an appointment for 4 PM tomorrow. Google Home or the Assistant should respond with confirmation of the appointment.
If you plan to complete other codelabs that involve Dialogflow, then skip this section for now and return to it later.
Delete the Dialogflow agent
- Click next to your existing agent.
- In the General tab, click Delete This Agent.
- Type Delete into the dialog and click Delete.
You built a chatbot and created an Action out of it. You're now a chatbot developer!
Check out the code samples at the Dialogflow Github page to learn more.