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 apps. This also gives you the best chance for getting your apps 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 answer off the top of their heads. 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
TTS Voices. When you deploy your action, you also get to choose a TTS voice for your action. See what they sound like!
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.
Think of an app name
Your app name is the primary way that users invoke your app, so it's very important that you pick a good one. If your app 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 app. 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 refuse 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 action 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 app 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 app by its name, in this case Number Genie. This triggers an intent to invoke the app.|
|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 API.AI. 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.|