When you extend the Google Assistant's functionality, you create Actions that let users get things done through a conversational user interface. Because conversational interfaces are most likely a novel thing for you to design, we highly recommend you go through our design processes and best practices when building your Actions. This also gives you the best chance for getting your Actions approved when you submit them for approval.
The best way to start building Actions is defined by our design principles, but here's a quick rundown of how to put our principles in practice.
Pick use cases
Conversational interfaces work best for use cases that fall into these general categories:
- Things people can easily answer. Actions that can be accomplished with familiar input like times or dates, like booking a flight.
- Quick, but compellingly useful Actions. These usually give users a lot of benefit for very little time spent, such as ordering items quickly.
- Actions that are inherently better suited for voice. These are typically things you want to do hands-free, like hearing a recipe while cooking or making a mental note while driving.
Create a persona
Personas help you design and write your conversations, so choose one early on to make it easier to pick the right words, syntax, and structure. Personas can range from happy, sad, self-deprecating, formal, and anything in between.
Remember, since users will perceive a persona whether you plan for one or not, it's in your best interest to frame the experience the way you want to be perceived instead of leaving it up to chance.
TTS Voices. When you deploy your Action, you can also choose a TTS voice for your Action. You can listen to samples of all available TTS voices on the Language and Locale Support page.
Think of an invocation name
Your invocation name is the primary way that users invoke your Action, so it's very important that you pick a good one. If your invocation name is hard to pronounce, sounds like other words, or can't be recognized well by Google, then it's likely that users have a hard time starting your Action. Start thinking of names that reflect your persona and brand but still adhere to these guidelines.
Now that you have chosen a few use cases and decided on a persona, you might be tempted to dive into development, but resist the urge! Instead, start by jotting down the dialogs that make up your conversation with a pencil and paper, or anything you prefer that gets you writing quickly.
When you design UIs that need to work on devices with audio support, display support, or both, we recommend that you start writing the spoken conversation first. Writing the spoken conversation will give you all the dialogs you need for your audio-only experience, and from there, you can supplement that with features such as cards, lists, and other affordances to enhance the experience on screens.
When writing your sample dialogs, be sure to account for these scenarios:
- A "happy path" that isn't too complicated and accomplishes the task in the easiest way.
- Additional paths that users might take to come to the same ending as the "happy path".
- Conversation repair scenarios where users do something unexpected, such as asking to do something you don't support or not being able to understand them.
- Dialogs where users exit in the middle of a conversation or at the end of it when they've done what they wanted.
- Variations on how you greet users when your Action is invoked.
In this example, we have the happy path dialog for Number Genie, a number guessing game you can try now in the Google Assistant. This dialog depicts a typical happy path for the game, where the user successfully wins a round with three guesses.
|User||Hey Google, let me talk to Number Genie.|
|Developer Note: This first request describes how users invoke the Action by its name, in this case Number Genie. This triggers an intent to invoke the Action.|
|Google Assistant||Sure, here's Number Genie.|
|Number Genie||Welcome to Number Genie! I'm thinking of a number from 0 to 100. What's your first guess?|
|Developer Note: This is the Action's welcome response and handles the previous intent that was triggered.|
|Developer Note: The user says a number, which is parsed by Dialogflow. A corresponding intent is triggered and calls your fulfillment. The next two user responses trigger the same intent because the grammar is the same.|
|Number Genie||It's higher than 50. What's your next guess?|
|Number Genie||It's lower than 65. Next guess?|
|Number Genie||Congratulations, that's it! I was thinking of 60. Wanna play again?|
|Developer Note: The fulfillment finally detects the winning number and asks the user to play again. The user will trigger a different intent when this question is answered.|
|Number Genie||Alright, talk to you later then.|
|Developer Note: The fulfillment detects that the user wants to quit the game and ends the conversation.|