Skip to content

Latest commit

 

History

History
executable file
·
89 lines (61 loc) · 1.99 KB

README.md

File metadata and controls

executable file
·
89 lines (61 loc) · 1.99 KB

Backend

Project setup

Prerequisite: Install Conda

Follow the conda documentation: Installing Conda. See also Conda getting started

Setup your terminal (zsh example):

source ~/miniconda3/bin/activate
conda init zsh
eval "$(/home/slks/miniconda3/bin/conda shell.zsh hook)"

Install dependencies

conda env update --file backend/env.yml --name langchain --prune

NOTE: if dependencies added should be exported to env.yml:

conda env export > backend/env.yml --no-builds

Other Conda commands:

conda create langchain
conda deactivate # deactivate any active conda environment
conda activate langchain
conda env create -f backend/env.yml

#todo: try setting python version
conda create -n tf_env python=3.8 

Run the backend

cd backend && python api.py

Tests & coverage

cd backend
# run tests
python -m pytest 
# run coverage
coverage run --source=src -m pytest 
coverage report -m
# see coverage
coverage html

All in one:

pytest && coverage run --source=src -m pytest && coverage report -m

Generate coverage badge for README.md

cd backend
coverage-badge -o ../README.md_images/coverage.svg -f

NOTE: pipeline generation don't work

Project details

Default host/port is set in host.py.

You'll see operations' logs in console (see logUtil.py).

Flask api is implemented in api.py, this is also the main entry point.

OpenAi/langchain implementation in iaService.py.

Reference