This state initializes the dialog flow using the intent that's held by the iResult variable to trigger a subsequent state. Like nlpresult, Intent is common to most bot dialog definitions.
For the Pizzabot, the first state that the Dialog Engine encounters is called Intent. At runtime, the Dialog Engine traverses the state nodes from the top-down and executes the components. Each state definition is built around a component, which executes some function. States manage the logic within the bot flow.
The states section follows the variable definitions. You would probably define a variable for this entity in every flow you write. Holds the intent that's resolved from the user input. As its name implies ("nlp" stands for Natural Language Processing), this entity
Instead, it's used widely - you'll see it in almost every reference bot's dialog flow. Unlike the other entities in the context declaration, nlpresult is not specific to the PizzaBot. There's another variable, iResult, that's also defined by an entity called nlpresult. You can define these variables to hold literals, primitives, or the values extracted from from the user input by the entities.The variables defined for the Pizzabot do just that - they are defined by the Pizzabot entities that detect the user's preferences from the input text. You define the variables that are used throughout the dialog flow (that is, through the entire user-bot interaction) in the context section. Later on, you'll be updating this dialog flow to give PizzaBot users another option: specifying cheese! But before you get to that point, you'll need to get acquainted with some dialog flow concepts and how they apply to the PizzaBot's dialog flow definition.ĭialog flows have two main parts: the context and the states. You define the entire interaction that your bot has with its users using our version of YAML, OBotML. To see how the intents, entities, and components fit together, click the Flows icon in the left navbar. Its properties and actions enable it to function as the virtual gatekeeper, only allowing customers 18 years or older to continue. The PizzaBot uses one of these components, AgeChecker. The Components page lists all of these bot-specific components, which are known as custom components. They also perform actions that are specific to your bot as well. They can perform generic bot functions like prompting input from users and outputting your bot's replies. Components are individual functions that, when integrated into your bot's dialog definition (which we'll get to in the next step) propel the bot-user dialog forward. They have little, or no, application outside of this bot, but you can use the other entities - the built-in ones that we provide - in any bot. CheeseType and PizzaCrust are among the custom entities created for this bot. The entities page displays two types of entities: entities that are specific to this bot that describe pizza-specific concerns like CheeseType and PizzaCrust and entities that cover general topics, like time, currency, and location. When you pair them with an intent, you give it the context it needs to complete the user request. Entities identify vital pieces of information from the user input. The Intent Entities section of the page displays the entities associated with these intents. Your bot draws on these intents to detect what the user wants. Think of an intent as categorizing different types of user input. Intents are comprised of groupings of these utterances, which are meant to represent typical user statements. Description of this imageĬlick OrderPizza and then take a look at the Examples section of the page to see the set of sample user requests, which are also known as "utterances". You'll come back to this (and other) pages later when you build your own version of this bot.
The Bot Builder opens to the intents page, which shows the two tasks that this bot performs for its users: OrderPizza and CancelPizza. If you exited the Pizzabot, click the Pizzabot tile again. Before you build your own version of this bot, first get acquainted with the different pieces that make up the PizzaBot and find out about the Bot Builder along the way.