step to run backend to local
-
create environment use command
python -m venv env -
activate a environment
-
windows
./env/Scripts/activate"NOTE" IF YOU RUN ON PYTHON version 3.11 upper you should runSet-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestrictedon Powershell And run./env/bin/Activate.ps1 -
Mac
source ./env/bin/activate
-
install library from requirements.txt use command
pip install -r requirements.txt -
create a file
.envin ./ folder and add OPENAI_KEY -
use command
uvicorn main:app --reload --env-file .envto run fastapi in your local
docker run -d --name test-api-con -p 8000:8000 -e OPANAI_KEY test-api