Thumbnail for null by null

10m 39s1,500 words~8 min read
YouTube auto captions
Transcript source

YouTube auto captions

This transcript was extracted from YouTube's auto-generated caption track. The transcript below is server-rendered so it can be read, searched, cited, and shared without opening the original YouTube player.

AI Video Summary

This video provides a step-by-step guide on how to build a Google Assistant action using Actions Builder, specifically demonstrating the creation of a "Daily Inspiration" action that delivers random inspirational quotes. The process begins with creating a new project in the Actions Console, a web-based IDE for managing actions. The speaker opts for a blank project and custom invocation, leading into the Actions Builder where the conversational experience is defined.

The tutorial then delves into configuring the conversational flow, which involves setting up custom invocations (how users trigger the action), defining intents (user goals), and creating scenes (logical stages of the conversation). The "Daily Inspiration" action is built with a custom invocation like "Talk to Daily Inspiration," a main invocation intent, a "get quote" scene, and a "daily quote" intent. Initially, the action provides a hard-coded quote. To introduce dynamic content, the video demonstrates writing and deploying fulfillment code as a webhook using Firebase Cloud Functions, which includes an array of quotes and logic to select a random one. Finally, the action is updated to call this webhook, and the entire process is tested using the Actions Console simulator, showcasing how the action now delivers different quotes dynamically.

Key Takeaways

  • Google Assistant is an AI-powered virtual assistant available on over a billion devices, and its functionality can be extended by building custom actions.
  • Actions are conversations between users and your fulfillment, allowing users to achieve tasks through the Assistant (e.g., ordering coffee).
  • The Actions Console is a web-based IDE used to create, manage, and publish actions, while Actions Builder defines the conversational experience visually.
  • Building an action involves four main steps: creating a new project in the Actions Console, defining the conversational experience with Actions Builder (invocations, intents, scenes), writing and deploying fulfillment code for business logic, and testing with the Actions Console simulator.
  • Conversations follow a flow: user input matches an intent, the action processes the intent in a scene, and then responds to the user.
  • Fulfillment is business logic deployed as a webhook, enabling dynamic prompts, validation, and responses; for the "Daily Inspiration" action, Firebase Cloud Functions are used to fetch random quotes.
  • The actions console simulator allows for testing actions on a web page or device, verifying both the conversational flow and dynamic fulfillment.

Topics Covered

Google AssistantActions BuilderConversational AIWebhook DevelopmentFirebase
Pull quotes
[0:00]Today I'm going to talk about building your first actions for Google Assistant using actions builder.
[0:00]Google Assistant is an AI powered virtual assistant that is available on over a billion devices across smart speakers, phones, cars, TVs, and more.
[0:00]Users can interact with Google Assistant through conversation to get things done, and you can extend the functionality of the assistant by building your own actions.
[0:00]Actions are conversations between users and your fulfillment that let users get things done through the assistant, like ordering a coffee or booking a ride.
Use this transcript
Related transcript hubs

[0:00]Hello, my name is Paul, and I'm a software engineer here at Google. Today I'm going to talk about building your first actions for Google Assistant using actions builder. Google Assistant is an AI powered virtual assistant that is available on over a billion devices across smart speakers, phones, cars, TVs, and more. Users can interact with Google Assistant through conversation to get things done, and you can extend the functionality of the assistant by building your own actions. Actions are conversations between users and your fulfillment that let users get things done through the assistant, like ordering a coffee or booking a ride. When you build an action, you can use the actions console to configure your action and you can use actions builder to define your conversational experience. Before we dive in, let's take a look at the actions we'll be building today. I'm going to build an action called "daily inspiration" that will tell users an inspirational quote for the day. Okay, Google. Talk to daily inspiration. Here's your daily dose of inspiration. The best way to predict the future is to create it. Cool. So, this action has a pretty simple conversational experience, and in this video we're going to build the action from scratch using actions builder. We'll go through four steps. First, we'll create a new project in the actions console. Next, we'll use actions builder to define the conversational experience. Then, we'll write and deploy fulfillment code that contains the business logic for the action, and finally, we'll test the action using the actions console simulator. So let's get started. The first step is to create a new project in the actions console. The actions console is a web-based IDE that lets you create, manage, and publish your actions. To create a new project, visit console.actions.google.com. Click "new project," give your project a name, and click "create project." After the project is created, you'll see a few options to start building your action. For this video, we're going to choose "blank project" so we can build our action from scratch. Next, you'll see a page that lists all the ways you can invoke your action. We'll choose "custom invocation" since that's what lets us define the name of the action. This will take us to the actions builder, where we'll define the conversational experience for our action. Actions builder is a graphical IDE that lets you create and manage conversational experiences visually. You can define the custom invocations, intents, scenes, and types that make up your conversation. You can think of conversations as exchanges between a user and your action. These conversations follow a typical flow. First, the user says something. This input is matched to an intent, which represents a goal the user wants to achieve, like ordering a coffee. Then, your action processes the intent by executing business logic in what we call a scene. Finally, your action responds to the user. Now, let's use actions builder to build the conversational experience for our action. Our action will have a custom invocation, a main invocation intent, a get quote scene, and a daily quote intent. Let's begin by defining our custom invocation. The custom invocation is the entry point for your action and defines how users invoke your action by name. You can edit your custom invocation by navigating to the "custom invocation" tab in actions builder. Here, we'll update the global user utterances by adding some phrases that users might say to invoke our action. Let's add "talk to daily inspiration" and "speak to daily inspiration." Next, let's create a main invocation intent. The main invocation intent is the entry point for your action when a user invokes it by name, like "talk to daily inspiration." You can edit the main invocation intent by navigating to the "main invocation" tab. Here, we'll add some training phrases, which are examples of what users might say to invoke the action. Let's add "start daily inspiration" and "get my daily quote." Notice that the main invocation intent is associated with the start scene transition. A scene is a logical stage of a conversation and it's where the majority of your conversational logic is executed. You can think of scenes as game states in a video game. Scenes loop until they collect all the required information from the user, fulfill all conditions, and finally transition to another scene or end the conversation. The start scene is automatically generated by actions builder and handles the logic for the start of your action. Let's edit the start scene. By default, it sends a prompt to the user and transitions to the end conversation scene. We're going to edit the prompt to be more engaging. Then, we'll edit the transition to go to a new scene we'll create called "get quote." Now, let's create the get quote scene. This scene will contain the logic to actually get a quote and tell it to the user. The first step is to send a prompt to the user that tells them a quote. For now, we'll hard code the prompt, but later on we'll update it to be dynamically generated by our fulfillment. Let's make the prompt, "Here's your daily dose of inspiration. The best way to predict the future is to create it." Next, let's add a transition to the end conversation scene. Finally, let's create a daily quote intent. This intent will be matched when a user asks for their daily quote after the action has already started. Let's add some training phrases like "tell me a quote" and "what's my daily inspiration?" Finally, we'll add a transition to the get quote scene. This means that whenever the daily quote intent is matched, the get quote scene will be executed. So now we've built the conversational experience. Let's try it out in the simulator to see what we've built. The actions console has a web-based simulator that lets you test your action on a web page or on a device. Okay, Google. Talk to daily inspiration. Welcome to your daily dose of inspiration. What would you like to do? Tell me a quote. Here's your daily dose of inspiration. The best way to predict the future is to create it. Awesome. So now we have a working action. The problem is that the action always tells us the same quote. To fix this, we'll write some fulfillment code that dynamically generates a quote and tells it to the user. Fulfillment is business logic deployed as a webhook that lets you generate dynamic prompts, validate slot values, and respond to the user. When building fulfillment, you can use the actions on Google Node.js client library to make development easier. Now, let's write and deploy fulfillment code that contains the business logic for the action. Let's navigate to the "web hook" tab in actions builder and click "open your cloud functions project." This will open up a new tab in your browser with the Firebase console. Here, we'll define a cloud function that gets a random quote and sends it to the user. Let's replace the placeholder code with our code for the daily inspiration action. This code includes an array of quotes and a handler function that selects a random quote and uses the conversation.append function to send the quote to the user. Click "deploy" to deploy the fulfillment to Firebase. This may take a few minutes. Once the fulfillment is deployed, navigate back to the actions builder. Next, let's update the get quote scene to use our fulfillment. Let's remove the hard-coded prompt and instead enable the call your web hook option. We also need to define an event handler that's invoked after the web hook call returns. In the event handler, we'll send a prompt to the user and transition to the end conversation scene. For the prompt, we'll use a special syntax to refer to the prompt that's set by our fulfillment code. And now we're done. So now we've updated our action to use our fulfillment to dynamically generate a quote. Let's try it out in the simulator to see what we've built. Okay, Google. Talk to daily inspiration. Welcome to your daily dose of inspiration. What would you like to do? Tell me a quote. The best way to predict the future is to create it. Okay, Google. Talk to daily inspiration. Welcome to your daily dose of inspiration. What would you like to do? Tell me a quote. Always deliver more than expected. Cool. So now our action is telling us a different quote each time. And that's it. In this video, we've built our first action for Google Assistant using actions builder. We've created a new project in the actions console, used actions builder to define the conversational experience, written and deployed fulfillment code, and tested the action in the actions console simulator. Thanks for watching, and stay tuned for more videos to help you build great experiences with Google Assistant.

Need another transcript?

Paste any YouTube URL to get a clean transcript in seconds.

Get a Transcript