Users engage Google Assistant in conversation to get things done, like buying groceries or booking a ride or in our case to reach out to solve an issue (for a complete list of what's possible now, see the Actions directory.) As a developer, you can use Actions on Google to easily create and manage delightful and effective conversational experiences between users and your own 3rd-party fulfillment service. We will learn How to build an App for Google Assistant using Dialogflow Enterprise Edition and Actions on Google. This tutorial is a part 2 continuation of our previous tutorial on How to create a chatbot using Dialogflow Enterprise Edition and Dialogflow API V2.
By the end of this tutorial, you will have a better understanding of the following:
As mentioned earlier, this tutorial is a part 2 continuation of the previous tutorial. Follow the steps from 1 to 8 from the previous tutorial and come back here to continue with this tutorial. Most of the project creation, setup, creating dialogflow agents and storing the information in Google Cloud Datastore is already covered in part 1.
The actions simulator in the Actions Console lets you test your apps through an easy-to-use web interface that lets you simulate hardware devices and their settings. You can also access debug information such as the request and response that your fulfillment receives and sends.
The app/action we built so far does exactly as we intended but we also notice that the overall experience can be a whole lot better. We noticed that our app when spelling out the ticket number, it spells out it in cardinal format. However, we would like the ticket number to be spelled out in digits or individual characters. Since this tutorial is about How to build an App for Google Assistant using Dialogflow Enterprise Edition and Actions on Google, we need to make sure that our app is more engaging and natural when used over conversational dialogue.
When returning a response to the Google Assistant, you can use a subset of the Speech Synthesis Markup Language (SSML) in your responses. By using SSML, you can make your agent's responses seem more life-like.To add SSML in our responses, we need to modify our cloud functions.
The root element of the SSML response.<say‑as>Lets you indicate information about the type of text construct that is contained within the element. It also helps specify the level of detail for rendering the contained text.
Learn more about SSML markup responses here.
From the previous demo, you would have noticed that our app needs to be canceled to end the conversation. However, we can automatically end the conversation once we have gathered all the information. So once the app replies back with the ticket number, we can end the conversation.
You can also test your app using your Google Home/mini/phone or any device running Google Assistant. Make sure that you have enabled your test draft in Actions on Google console. Your app should run on any device running Google Assistant linked to your account (google account used to create this project)You can test your app on Google Home by saying "OK Google, Talk to my test app".[embed]https://youtu.be/u9y0nsmrMY4[/embed]You can also check all the data appear in the Google Cloud Datastore with the user info and ticket details.
In order for users to interact with your action/app, we need to add an invocation name that they can use to invoke our action.Users verbally say the Invocation name to invoke your Action. For example, if the Invocation name is Mr. Pixel, users can say: OK Google, Talk to Mr Pixel.
Theme customization lets you customize the look and feel of your Actions to highlight your brand identity to users. After customizing the theme, save your changes and test them out in the Simulator.Make sure to check out the Invocation and Discovery Checklist to see if you have covered all the checklist.
Before you deploy and publish your application/action. Make sure to go through the Publishing Checklist. Finally, Fill in all the required information under Deploy section.
So to conclude, we have successfully built an action for the Google Assistant. The purpose of this tutorial was to show you How to build an App for Google Assistant using Dialogflow Enterprise Edition and Actions on Google. There are still lots of things you can add to make the overall conversational experience a lot better. You can also train your agent with a lot of training data using Dialogflow. I will be covering a lot more on Actions on Google and Google Assistant in the upcoming tutorials. Let me know what you would like me to cover in the future tutorials in the comments below. You can also check out other tutorials like Build your own Google Voice Assistant without code and How to create a chatbot using Dialogflow Enterprise Edition and Dialogflow API V2. Also check out TechWithSach.com for more interesting tutorials on machine learning, AI, Flutter, unity and more.