This demo illustrates a pizza ordering bot, supporting single pizza ordering by:
- recognizing pizza toppings from user utterances
- managing toppings inventory and responding appropriately
- remembering previous orders and speeding reordering of an identical pizza
This tutorial requires that the pizza order bot is running
npm run demo-pizza
In the Model list of the web UI, click on TutorialDemo Pizza Order.
The model contains three Entities:
- "Toppings" accumulates the user's specified toppings, if available.
- "OutofStock" signals the user the selected topping is out of stock
- "LastToppings" contains the historical toppings from their previous order
The model contains a set of Actions that asks the user's for their topping selection, accumulated toppings and more.
Two API calls are provided as well:
- "FinalizeOrder" handles order fulfillment
- "UseLastToppings" processes historical toppings information
Several Training Dialogs are found in the Model.
Let's train the Model a bit more by creating another Train Dialog.
- On the left panel, click "Train Dialogs", then the "New Train Dialog" button.
- In the chat panel, where it says "Type your message...", type in "Order a pizza with cheese"
- The word "cheese" was extracted by the entity extractor.
- Click the "Score Actions" button.
- Select the response, "You have cheese on your pizza."
- Select the response, "Would you like anything else?"
- In the chat panel, where it says "Type your message...", type in "add mushrooms and peppers"
- Click the "Score Actions" button.
- Select the response, "You have cheese, mushrooms and peppers on your pizza."
- Select the response, "Would you like anything else?"
- In the chat panel, where it says "Type your message...", type in "remove peppers and add sausage"
- Click the "Score Actions" button.
- Select the response, "You have cheese, mushrooms and sausage on your pizza."
- Select the response, "Would you like anything else?"
- In the chat panel, where it says "Type your message...", type in "add yam"
- Click the "Score Actions" button.
- The "yam" value was added to "OutofStock" by the entity detection callback code, as the text did not match any supported ingredients.
- Select the response, "OutOfStock"
- Select the response, "Would you like anything else?"
- In the chat panel, where it says "Type your message...", type in "no"
- The "no" is not marked as any type of intent. Rather, we'll be selecting the relevant Action based on the current context.
- Click the "Score Actions" button.
- Select the response, "FinalizeOrder"
- Selecting this Action resulted in the customer's current toppings getting saved to the "LastToppings" Entity, and deletion of the "Toppings" Entity by the FinalizeOrder callback code.
- In the chat panel, where it says "Type your message...", type in "order another"
- Click the "Score Actions" button.
- Select the response, "Would you like cheese, mushrooms and sausage?"
- This Action is available now due to the "LastToppings" Entity being set.
- In the chat panel, where it says "Type your message...", type in "yes"
- Click the "Score Actions" button.
- Select the response, "UseLastToppings"
- Select the response, "You have cheese, mushrooms and sausage on your pizza."
- Select the response, "Would you like anything else?"
[!div class="nextstepaction"] Deploying a Conversation Learner bot