Teneo Developers

Pizza order

The 'Pizza order' solution contains a flow for ordering pizzas with different kinds of crusts and toppings. Before the final order is sent, the user will be prompted for a confirmation. At this point, more toppings can be added or removed. The solution also contains additional flows allowing the user to ask for more information on available pizza choices as well as to cancel their order.

pizza

Core concepts

This solution showcases the following Teneo concepts:

  • Data actions
  • Entities
  • Flow listeners
  • Flow variables
  • Global variables
  • Loop back
  • Match requirements
  • Skip conditions

Flow outline

This is the outline of the solution's main flow User wants to order a pizza:

Pizza order example solution - flow outline

Example conversations

One way a pizza can be ordered is by classical slot filling, where the bot guides the user to the next slot to be filled:

User: I want to order a pizza
Bot: Which crust would you like? Italian/thin or American/pan?
User: Italian, please.
Bot: Which toppings do you want on your thin pizza?
User: I'll take ham and mushrooms.
Bot: So, I have a thin pizza with the following toppings: ham, mushrooms - Any other toppings you would like to add?
User: No.
Bot: Alright, thanks for your order. We are now preparing your thin pizza with mushrooms and ham.

However, the user does not need to wait for the bot to prompt for information: all information can be given when it suits the user best, just like in a human interaction. The bot will listen for the crust type and up to 4 toppings and store them:

User: I want to order an American pizza with cheese, onions, and pepperoni
Bot: So, I have a pan pizza with the following toppings: cheese, onions, pepperoni - Any other toppings you would like?
User: I'll have some mushrooms as well.
Bot: Ok, I have updated your order. So, I have a pan pizza with the following toppings: cheese, mushrooms, onions, pepperoni - Any other toppings you would like?
User: No
Bot: Alright, thanks for your order. We are now preparing your pan pizza with cheese, mushrooms, onions, pepperoni - Enjoy!

The user can also not only add but also remove toppings:

User: I want to order a thin pizza with broccoli, mozzarella, and salami
Bot: So, I have a thin pizza with the following toppings: broccoli, onions, mozzarella, salami - Any other toppings you would like?
User: I'll have some bacon instead of salami and remove the broccoli please.
Bot: Ok, I have updated your order. So, I have a thin pizza with the following toppings: bacon, onions, mozzarella - Any other toppings you would like?
User: No
Bot: Alright, thanks for your order. We are now preparing your thin pizza with bacon, onions, mozzarella - Enjoy!

Finally, once the user has placed an order for a pizza, they can cancel that order. If no order has been placed, the bot asks the user if they would like to make an order. If an order has been placed, the user can confirm whether they want to cancel it. For this flow ('User wants to cancel order') to handle this conversation, two global variables are used: pizzaOrdered, a boolean value, checks whether an order has been made, and currentOrder stores the current pizza order (if there is one).

User: I want to cancel my order.
Bot: You ordered a thin pizza with bacon, onions, mozzarella. Are you sure you want to cancel your order?
User: Yes.
Bot: Okay, your order has been canceled. Would you like to make a new order?
User: No.
Bot: Okay, don't hesitate to come back if you change your mind!

Solution components

The solution contains the following components:

2-components

Download

  1. Download the solution here.
  2. Import the solution into Teneo. For more details see How to import solutions.
  3. Once the solution has been imported, please make sure to assign the Lexical Resources called 'Teneo Lexical Resource English'.