This repository is a minimal example showing how to structure a chatbot using Clean Architecture and the Strategy pattern to integrate: Rasa, NLTK, ChatterBot, and custom rule-based scripts.
Files of interest:
src/controllers/chat_controller.py: central router using Strategy patternsrc/strategies/: strategy implementations and adapterssrc/data/faqs.json: minimal FAQ filerun.py: small runner that demonstrates routing
Setup (PowerShell):
# create and activate venv
python -m venv .venv
.venv\Scripts\Activate.ps1
# upgrade pip and install dependencies
python -m pip install --upgrade pip
pip install -r requirements.txt
# (Optional) start Rasa if you have a trained model
# rasa train
# rasa run --enable-api --cors "*"
# Run the example
python run.pyNotes:
- The example includes fallbacks so
run.pycan be executed without havingnltk,chatterbot, or a running Rasa server installed; however, to use the real integrations, install the packages listed inrequirements.txtand run a trained Rasa server athttp://localhost:5005.