This is a Rasa-powered chatbot designed for Christ College to provide information about the institute, its courses, location, contact details, and more.
.
├── actions.py
├── config.yml
├── credentials.yml
├── data
│ ├── nlu.yml
│ ├── rules.yml
│ └── stories.yml
├── domain.yml
├── endpoints.yml
├── models
├── README.md
└── tests
└── test_stories.yml
actions.py
: Contains custom actions for the bot.config.yml
: Configuration for the Rasa pipeline and policies.credentials.yml
: Credentials for connecting to messaging platforms.data/nlu.yml
: Contains NLU training data.data/rules.yml
: Contains rules for the bot's behavior.data/stories.yml
: Contains training stories for the bot.domain.yml
: Defines the bot's responses, intents, entities, slots, and actions.endpoints.yml
: Configuration for connecting to custom actions.models
: Directory where trained models are stored.tests/test_stories.yml
: Test stories for verifying the bot's behavior.
- Features
- Installation
- Usage
- Configuration
- Training the Model
- Running the Bot
- Connecting to Telegram
- License
- Provides information about Christ College.
- Lists various courses offered.
- Provides location, contact number.
- Python 3.7+
- pip
- Virtual environment (venv)
- Git
-
Clone the repository:
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Rasa:
pip install rasa
-
Initialize Rasa:
rasa init
-
Train the Rasa model:
rasa train
-
Make changes in the NLU, domain, and stories files:
- Edit
data/nlu.yml
for training examples. - Edit
domain.yml
for intents, responses, and actions. - Edit
data/stories.yml
for conversation flows.
- Edit
-
Connect to ngrok on port 5005:
ngrok http 5005
Copy the HTTPS link provided by ngrok.
-
Configure Telegram:
- Open
credentials.yml
and add your Telegram bot token and the ngrok HTTPS link.
telegram: access_token: "YOUR_TELEGRAM_BOT_TOKEN" verify: "YOUR_TELEGRAM_BOT_NAME" webhook_url: "YOUR_NGROK_HTTPS_LINK/webhooks/telegram/webhook"
- Open
-
Train the Rasa model again:
rasa train
-
Run Rasa actions server:
rasa run actions
-
Open a new terminal and run the Rasa server with API enabled and CORS support:
rasa run --enable-api --cors "*"
-
Run the chatbot on localhost 5005:
rasa run -m models --enable-api --cors "*" --debug
- affirm
- bot_challenge
- deny
- goodbye
- greet
- location
- christ_course
- christ_intro
- mood_great
- mood_unhappy
- mathematics
- physics
- computerscience
- bba
- chemistry
- contact_number
- certifications
- first
The bot provides various responses to user queries, including course details, contact information, and more.
User: Hi
Bot: Hi, thank you for contacting Christ College. How can I help you?
User: Tell me about your courses
Bot: We offer a variety of courses:
- BSC Mathematics
- BSC Physics
- BSC Computer Science
- BBA
- BSC Chemistry
User: Where is Christ College located?
Bot: CHRIST COLLEGE (AUTONOMOUS) IRINJALAKUDA, IRINJALAKUDA, THRISSUR, KERALA, 680121, INDIA
Custom actions are implemented in actions.py
. These actions can handle complex logic, integrate with external APIs, and provide dynamic responses.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request.