You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simurgh is your intelligent chatbot companion designed to assist Ferdowsi University of Mashhad students in finding answers to their educational and administrative queries. With Simurgh's help, navigating the university's academic landscape becomes effortless. Whether you're seeking course information, registration guidance, or campus resources, Simurgh is your trusted ally on the path to academic success.
Clone this repo: git clone https://github.com/JavidChaji/FUM-Simurgh.git
Run yarn to install dependencies
Starting Rocket.Chat:
yarn dev # run all packages
OR
yarn dsv # run only meteor (front and back) with pre-built packages
Rasa Prerequisites
PYTHON3 SUPPORTED VERSIONS
Currently, rasa supports the following Python versions: 3.7, 3.8, 3.9 and 3.10. Note that Python 3.10 is only supported for versions 3.4.x and upwards. Additionally, rasa installation on Apple Silicon with Python 3.10 is not functional in 3.4.x but will be supported starting from 3.5.x.
these steps are for linux
So We Install Python Version 3.10 in the virtual environment
python3.10 -m venv .venv
we can move to the virtual environment by:
source .venv/bin/activate
after moving to virtual environment we check if our python version are correct
python -V
and also make sure pip is installed
pip -V
Install Rasa and Upgrade pip (it's may take a while)
python -m pip install --upgrade pip rasa
so to see switches of rasa we can use
python -m rasa --help
to initiate ower rasa project we use this command (rasa will be asking you some questions and then you should be fine)
python -m rasa --init
Rasa and Rocket.Chat Connection
2. Rocket.Chat Bot User Configurations
Create a Rasa bot user in Rocket.Chat. You can either manually login to Rocket.Chat and create a bot user via the
user management page or can use the following script to create the bot user.
Run the following command to create the RASA bot.
Note: Please replace the user name and password of the RocketChat admin and bot user accordingly.
Train the Machine Learning Model
The Rasa bots machine learning model can built by using either Rasa CLI or Docker. After the training a machine
learning model will be created inside the bot_rasa/models folder.
If using Docker
docker run -it -v $(pwd)/bot_rasa:/app rasa/rasa train
If using Rasa CLI
pip3 install rasa
cd bot_rasa
rasa train
4. Start Rasa server
Rasa bot can be started via the Docker or Rasa CLI.
If using Docker-compose
docker-compose up -d bot_rasa
If using Rasa CLI
cdbot_rasarasarun--enable-api--debug
5. Make Rasa Bot accessible by Rocket.Chat
The Rasa bot should be reachable via Rocket.Chat.
If you are following the tutorial with docker-compose file then following is the URL to access the Rasa bot.
http://bot_rasa:5005
If you are trying to connect to a standalone Rocket.Chat instance or using Rasa CLI, lets user ngrok to get a
public url for the Rasa Bot. (or just use localhost:5005)
After downloading the ngrok navigate to the ngrok file in the downloded content and execute the following command.
This will provide a public URL to the Rasa bot
./ngork http 5005
Following will be the output of ngrok
Session Status online
Session Expires 7 hours, 59 minutes
Version 2.3.30
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://e3d5a17b.ngrok.io -> http://localhost:5005
Forwarding https://e3d5a17b.ngrok.io -> http://localhost:5005
Copy the http URL provided by ngrok: http://e3d5a17b.ngrok.io
6. Configure Rocket.Chat webhook
Go to Administration > New Integration > Outgoing webhook.
Inside the configuration insert this:
Event Trigger: Message Sent
Enabled: True
Channel: #general
URLs: http://bot_rasa:5005/webhooks/rocketchat/webhook
Post as: bot_rasa
If you are using ngrok then replace the URL http://bot:5005, with the url obtained by ngrok.
Type @bot_rasa hello to start a conversation with the Rasa bot
Additional Information
If you want the Rasa bot to direct message with the users create another webhook with the following configurations
Event Trigger: Message Sent
Enabled: True
Channel: all_direct_messages
URLs: http://bot_rasa:5005/webhooks/rocketchat/webhook
Post as: bot_rasa
Installation
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
Fork the Project
Create your Feature Branch (git checkout -b feature/AmazingFeature)
Commit your Changes (git commit -m 'Add some AmazingFeature')
Push to the Branch (git push origin feature/AmazingFeature)