To install the necessary dependencies for this project, use the following command:
pip install -r requirements.txt
If you wish to improve the performance, please configure a Redis service on your local machine and install the Python redis dependency:
pip install redis
For the proper functioning of this project, you need to set some environment variables.
-
Create a new file in the project root directory with the name
.env
. -
The content structure of
.env
should mirror that of.env.example
. However, make sure to update specific values. Particularly:- Replace the placeholder for the
OPENAI_API_KEY
with your actual API key. - Replace the placeholder for the
REDIS
with your actual Redis password.
- Replace the placeholder for the
Note: If you're planning to run the project locally without Redis, maintain the REDIS
attribute as given in .env.example
without any changes.
Once you've set up the environment variables, you can execute the project with:
python moderator.py
To ensure code consistency and quality, this repository utilizes the pre-commit
tool to automatically format code. Before making any contributions or commits, it's recommended that you set up pre-commit
.
-
Install
pre-commit
: Use the following command to install or upgradepre-commit
:pip install -U pre-commit
-
Install Git Hooks: Once
pre-commit
is installed, you'll need to set it up for this repository. Run the following command:pre-commit install
After setting up, the pre-commit hooks will automatically check and format your changes before each commit. This helps to maintain code consistency throughout the project.