With the Google Assistant SDK, you can embed the Google Assistant into your own project, making it function similarly to a Google Home. However, your project may have unique hardware capabilities that Google Home does not have: for example, it may have a unique LED display with customizable brightness and color settings.
Device Actions are a set of tools and APIs that allow you to extend what the Assistant can do, in the projects you develop, to take full potential of their hardware capabilities.
Built-in Device Actions
Google has created a wide range of common Built-in Device Actions for everyday things, including lights, appliances, and cameras. With these actions, you harness the power of the Google Assistant's natural language processing to control your project. For example, a project with a light can be turned on in different ways:
- Ok Google, turn on the light.
- Hey Google, turn my light on.
- Ok Google, turn on my living room light.
Of course, you can create your own project that responds to commands for many Smart Home traits like:
- Ok Google, set the brightness to 50%.
- Hey Google, set the temperature to 98 degrees.
Custom Device Actions
You can also create Custom Device Actions for your own unique hardware. For these actions, you define the grammar and commands:
- Ok Google, blink my light 5 times.
- Hey Google, move left.
Learn more about incorporating these actions using the Google Assistant service.
How it works
The device has the Google Assistant SDK installed on it along with credentials for accessing the Google Assistant Service. The device sends out the spoken request (Turn on.) and asks the service to turn on the device's onboard LED. The device also sends its model and device instance identifiers so the service can determine how to best respond in context to the request.
The service uses Automatic Speech Recognition (ASR) to determine what words were spoken by the user, Natural Language Processing (NLP) to analyze and understand the meaning of the request from these words, and device matching to provide context for the request. This context is important because it defines the actions the device supports and how these actions should be fulfilled.
The service then responds with text that is spoken back to the user (Sure.) along with the device-specific command. The device knows how to handle this command: it turns on its LED!
Bring your ideas to life by embedding the Google Assistant into your project and then adding unique functionality with Device Actions. You can develop your project using the Google Assistant service.