-
Git clone from repo
git clone https://github.com/richkirk1/rasa-chatbot.git [<directory>]
-
Create virtual environment
python3 -m venv .venv
-
Activate virtual environment
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
python3 -m spacy download en_core_web_md
pip install -e .
curl -L https://install.meilisearch.com | sh
https://docs.meilisearch.com/learn/getting_started/quick_start.html
npm install
To train a model, use rasa train
(this will take a significant amount of time; if you wish to train it faster, try the command with --augmentation 0
).
First set up the action server in a separate terminal window:
rasa run actions
These are custom actions that require connections to external services and what not.
In another terminal window, run the bot:
rasa shell --debug
In the last terminal window, run meilisearch:
./meilisearch
The --debug
flag produces a lot of output meant to help understand how the bot is working under the hood. To have a normal conversation, run without the --debug
flag.
To run the interface you will need three seperate terminals.
First set up the action server:
rasa run actions
In the second terminal we will need run rasa on a live server.
rasa run --cors "*"
In the third terminal window we will set up a local server for the interface to run. It is important that you are within the interface directory when running this command.
npm start
After running rasa train
, run the command:
rasa test core
rasa test nlu
Postman is a service for testing APIs, is useful for testing Rasa custom actions and Rasa forms.
Here is a Postman team invite link:
To test with postman, first run the actions server:
rasa run actions
In another terminal window, run the bot server:
rasa run --enable-api --debug
Then, in the postman UI, you can run tests on the Collections (https://learning.postman.com/docs/running-collections/intro-to-collection-runs/).
data/
- contains stories, rules, and nlu (training data)
actions/
- contains custom action code
domain.yml
- the domain file, including bot response templates
config.yml
- training configurations for the NLU pipeline and policy ensemble
GCP STEPS
- Create a new project
- Create a brand spanken new vm
- Reserve static ip for vm
- Set UNSAFE firewall rule (can fix later)
- Create new rule w/ properties:
- Target: all instances
- Direction: ingress
- Source IP ranges: 0.0.0.0/0
- Ports and protocols: allow all
VM STEPS
- Update and upgrade
- sudo apt update
- sudo apt upgrade
- Install git
- sudo apt install git
- Clone the relevant repository
- git clone [URL]
- Install docker
- sudo apt install docker
- Train model & build rasa-server WARNING: High Server Impact
- sudo docker build -t rasa:latest .
- Build action-server
- sudo docker build -t actions:latest ./actions
- Build the react interface and apache-server
- sudo docker build -t interface:latest ./interface
- Create Docker Network
- sudo docker network create deployment-network
- Run meli-server
- sudo docker run -it -d --rm --network deployment-network -p 7700:7700 --name meili-server -v $(pwd)/meili_data:/meili_data getmeili/meilisearch:v1.1
- Run actions server - sudo docker run -d --rm -v "$PWD"/actions:/app/actions --network deployment-network -p 5055:5055 --name action-server actions:latest
- Run Rasa server - sudo docker run -it -d --rm --network deployment-network -p 5005:5005 --name rasa-server rasa:latest
- Run apache server - sudo docker run -d --rm --name apache-container -p 80:80 interface:latest
Helpful Docker commands:
- List containers
- sudo docker container ls -a
- Destroy all containers
- sudo docker rm -f $(sudo docker ps -a -q)
- Check used docker space
- sudo du -sh /var/lib/docker
- Destroy EVERYTHING
- sudo docker system prune -a -f --volumes
To develop code for this bot:
-
First activate the virtual environment
source .venv/bin/activate
-
If you haven't already, install the required packages
pip install --upgrade pip pip install -r requirements.txt python3 -m spacy download en_core_web_md pip install -e .
-
Create a new branch, either through extensions or via the terminal (
git checkout -b <branch_name>
) -
Make changes as necessary and make commits
-
Push the local branch with changes to the remote repo:
git push -u origin <branch-name>
-
Submit a PR following this guide (https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request?tool=webui)