Skip to content

Latest commit

 

History

History
92 lines (56 loc) · 2.21 KB

Setup_EN.md

File metadata and controls

92 lines (56 loc) · 2.21 KB

Initial setup

Install requirements

This section describes the steps to follow to be able to run the project locally.

  1. Create the python virtual environment
python -m venv venv
  • If python3-venv is not available, install it:
sudo apt install python3.10-venv
  1. Enter the virtual environment
source venv/bin/activate
  1. Install the requirements
pip install -r requirements.txt

Activate the API-KEY

  1. 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

  1. Save and close the file.

  2. Reopen all the consoles that are being used for the change to take effect

Run scripts from the proyect

Once the steps of the initial setup are completed, follow these steps to be able to run the project.

  1. Navigate to the base of the project
  2. 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

The ai command

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"