Hi. I'm Priscilla Moraes. I'm a Machine Learning Specialist at Google. In the previous module, as we walked through the life of a conversation, we highlighted the elements that users have come to expect from today's conversational agents, like being able to understand user intention, having awareness of context, etc. In this module, you will learn how to create a conversational agent in Dialogflow and use Dialogflow's console to program the intents, provide training phrases, and specify entities to train your agent to have these capabilities. To explain these concepts, we will use the example of a pizza-ordering chat bot and show you what the intents and entities may look like. We will also share some best practices along the way. So, let's dive into it. It always starts with intents. Intents are the trunking joints of the dialogue tree. It connects all of the branches. Intents determine where conversation will go and what an agent should do. In communication, intents can be thought of as the root verbs in the dialogue, such as wanting coffee translating to acquiring a beverage. Sometimes, being intents are not explicit and instead are inferred from the entire composition of a phrase. You want to map your intents to the goal of your obligation. If you're a help desk application, then your intents might include opening or filing a ticket, updating a ticket, closing a ticket. But your application may also need to access and update a user's account information, range over to a live technician, and even pass a longer quality assurance survey. Even affirmation, answering yes or no, is an intent. Intents evolve as your understanding of the users' needs evolves. You may find yourself doubling or tripling your intents beyond the draft side of intents. To make the task of defining intents easier, some rules of thumb can be applied. First, identify the verbs in the dialogue people will have with your agent. Doing that will allow your agent to have its actions mapped to needs from the user. Another possible scenario is to identify where the application should branch logic. Here's some examples. "Two mocha coffees please." "How many calories in a slice?" "I want a pizza" Or even, "I really need some caffeine." Once you have chosen your intents, you need to train your agent to recognize them. This can be done with the use of training phrases. The training phrases for each intent should be representative of how users manifest such intent. It is always a good idea to add variations to the grammatical construction of a request, using passive versus active voices, questions versus statements, and etc. When creating an intent, the more training phrases you can think of, the better. Later, we will discuss best practices for writing your training phrases. Let's do a quick activity. Can you come up with at least 10 different ways of ordering pizza? Your training phrases can be generic. I want a pizza. Which specific? Can I have a slice of pepperoni pizza? Needless to say, you could even add details such as the type of crust. It all depends on your use case. Take a few seconds to think about it. Here are some examples of additional training phrases. I will use these examples when I create my pizza-ordering intent in the Dialogflow console. Let's see how we can do that. All right. So, here's the dialogue for console. You can get here by going to console.dialogflow.com. As you can see, the left sidebar contains a menu with many options. I have already gone ahead and created my agent called agent one. Now, I'm ready to set up my intents. On the intents page, we can create new intents. By clicking create intent, we can choose a name for our intent. I'm going to choose order.pizza for the example we've been discussing. Scrolling down to the training phrases, click add training phrase. Here, you can enter the examples we've talked about. So, I would say, ''Can we have a pizza, please?'' Or, ''I would like to order a pizza now.'' Once you answered all of the training phrases, you can click the save button. You'll notice that the agent will start training once you introduce changes to it. If you want to test any other changes that you made, wait until the training is completed, and then test your agent. So, now, I'm going to go ahead and switch to another agent, which I have already added more training phrases, and that's agent two. So, if you see here, we have a larger list of training phrases that I entered and saved. I'm going to click save again, just to have my agent trained. Once it's completed, I can then test. So, to test if an intent was properly trained, we can use the right sidebar where it says, ''Try it now.'' Here, we can enter the example and see if the agent is able to detect what intent the example is about. So, let's try the example. Can I pick up a cheese pizza in two hours? Notice that here in this section, user says, it shows exactly what the user typed or said. The default response is not available because we did not configure any responses for the agent to provide once it attached the intent, but it did become the right intent: order pizza. Notice that even though the example that I entered is not part of the training phrases, so we do not mentioned anything in two hours, or we did not say anything about cheese pizza. The agent was still able to attach the right intent because it does semantic similarity between the training phrases in the new example. So now, when you go back to the intents page, we see that besides the one that we just created, they're two there were already there, and they are both default intents. The first we're going to look at is the default welcome intent. This intent allows the agent to recognize greetings from the user. So, when the user says, ''Hi," "Hello," "How are you?'' the agent will be able to then respond with a greeting back, and ask how it can help the user. We don't need to provide those. Those intents come automatically with the agent. As for the fallback intent, well, let's talk more about it later. There is a special type of intent called fallback intent. Fallback intents are, as the name suggests, a fallback for in the agent does not understand what the user is asking for. You can try asking a question to your order agent about the weather and see what happens. You will notice that you don't need to specify the answers the agent will return for fallback intent. That's why this is an intent that is automatically created for each new agent. There is also an intent called followup intent. We will talk about these when we cover contacts in the next module. Here's some best practices to follow in defining intents for your agent. When choosing the training phrases to train an intent, make sure to consider the different ways users might convey that intention. This can vary from diverse vocabulary to different grammatical constructions of a phrase or sentence. Another important aspect is to keep your intents not ambiguous. That means avoiding situations where similar requests are mapped to different intents within the agent. It is always a good idea to start the development of your agent focused on addressing the most common requests from the user. This will allow the application to quickly take advantage of the ability of the agent to address users' requests.