This section describes the steps to follow to be able to run the project locally.
- Create the python virtual environment
python -m venv venv
- If
python3-venv
is not available, install it:
sudo apt install python3.10-venv
- Enter the virtual environment
source venv/bin/activate
- Install the requirements
pip install -r requirements.txt
- Open with an editor the file .bashrc of the user's home
(To see the user's home you can run cd
in any console)
In some place of the file, export the api key:
export OPENAI_API_KEY=sk-U<...>L
-
Save and close the file.
-
Reopen all the consoles that are being used for the change to take effect
Once the steps of the initial setup are completed, follow these steps to be able to run the project.
- Navigate to the base of the project
- Activate the project's environment
source venv/bin/activate
Now you can run any .py file from the project directly.
The main executable of the project is located in /prompter/app.py
To be able to use this repo from any console, you can optionally do this step to add an alias to the command line function.
Assuming that the virtual environment was made in the base of the repository with the name venv
as specified in the initial setup, you must open the .bashrc
file of the user's home
to open it you can do
cd
nano .bashrc
or replace nano
with any text editor.
At the end of the file, add the following lines:
export PROMPTER_HOME_DIR=/home/amd/Proyects/Prompter
alias ai="$PROMPTER_HOME_DIR/venv/bin/python $PROMPTER_HOME_DIR/prompter/app.py"
replacing what is to the right of PROMPTER_HOME_DIR=
with the path where the repository was cloned.
To check if it worked, open a new console and type ai echo test
and should repeat the message "test"