How to play? One-click helper:
make start-app🍕 Rasa Pizza Shop Assistant - An intelligent chatbot for ordering pizzas and drinks!
This starter pack demonstrates building a pizza delivery chatbot using the Rasa framework with the following features:
- Three sizes: Small (€12), Medium (€14), Large (€18)
- Three pizza types: Margherita (€2 discount), Marinara, Hawaiian
- Automatic price calculation with discount support
- Custom pizzas with topping selection
- Cola, Sprite, Fanta Orange (€2.50)
- Water (€1.50)
- Juice (€3.00)
- Beer (€4.00)
- Wine (€5.00)
- Order ID generation for pickup identification
- Order summary display
- Checkout process with total calculation
- Order history tracking
- Business hours inquiry by day
- Menu display with prices and discounts
- Help and support responses
config.yml # Rasa configuration
credentials.yml # Service credentials
endpoints.yml # Endpoint configuration
requirements.txt # Python dependencies
Makefile # Build automation
actions/
├── __init__.py
├── database.py # In-memory database with menu and orders
└── actions.py # Custom actions (add pizza, drink, etc.)
data/
├── nlu.yml # NLU training data
├── stories.yml # Conversation flows
├── pizzas/
│ └── order_pizza.yml
├── drinks/
│ └── order_drinks.yml
└── general/
└── general.yml
domain/
└── domain.yml # Intents, entities, slots, responses
tests/
├── happy_paths/ # Standard business flows
└── demo_scripts/ # Full workflow demonstrations
chatwidget/
├── index.html # Chat interface
└── style.css # Styling
prompts/
└── templates.py # Jinja2 prompt templates
- Python 3.8+
- pip (Python package manager)
-
Clone or navigate to the project
cd /Users/wangyiju/Documents/LenguajeN/rasa-pizza-shop -
Install dependencies
make install
Or manually:
pip install -r requirements.txt
-
Train the model
make train
Build and run with Docker:
make docker-build
make docker-runmake shellIn one terminal:
make runIn another terminal:
make action-servermake run-allAfter starting the servers, open chatwidget/index.html in your browser.
Run end-to-end tests:
# All tests
make test
# Happy path tests only
make test-happy-paths
# Demo workflow
make test-demoUser: Hi, I'd like to order a pizza
Bot: Welcome! I'll help you order.
User: I want a medium margherita pizza
Bot: Great! Added Medium Margherita pizza for €12.00 to your order.
User: I'm done
Bot: Order confirmed! Your order is #ABC123D. Pickup in 30 minutes!
User: Show me the menu
Bot: [Displays pizza and drink options]
User: I want a large hawaiian pizza and a beer
Bot: Added Large Hawaiian pizza for €18.00...
Added Beer for €4.00...
User: Checkout
Bot: Order confirmed! Total: €22.00
User: I want a custom pizza
Bot: What size and type would you like?
User: Large, with extra cheese, mushrooms, and olives
Bot: Added Large pizza with extra toppings...
- Framework: Rasa (CALM framework recommended for production)
- Language: Python 3.8+
- NLU: Rasa NLU with TED policy
- Storage: In-memory database
- Frontend: HTML5 + CSS3
For Rasa Pro with GPT-4 (update config.yml):
export OPENAI_API_KEY=your-api-keyEdit actions/database.py in the PIZZA_TYPES dictionary:
PIZZA_TYPES = {
"my_pizza": {"name": "My Pizza Name", "discount": 1.0},
}Edit actions/database.py in the DRINKS dictionary:
DRINKS = {
"my_drink": {"name": "My Drink", "price": 3.50},
}Edit actions/database.py in the BUSINESS_HOURS dictionary:
BUSINESS_HOURS = {
"monday": "10:00 - 22:00",
}# Clean up generated files
make clean
# Clean everything including virtual environment
make clean-all
# View all available commands
make help- Local Development: Use
make run-all - Docker: Use
make docker-run - Rasa Cloud: Deploy via Rasa Cloud dashboard
- Custom Server: Configure endpoints.yml for your infrastructure
Ensure the action server is running:
make action-serverChange ports in your Rasa command:
rasa run -m models --port 5006
rasa run actions --port 5056Check if Rasa server is running on port 5005 and CORS is enabled.
For production use with CALM framework:
-
Install Rasa Pro:
make install-rasa-pro
-
Update
config.ymlto use CALM policies -
Use GPT-4 for better NLU and dialogue management
This starter pack is based on Rasa's retail banking example and is free to use and modify locally.
Ready to serve pizzas with AI! 🚀🍕