This repo contains the code necessary to run the backend application for generating nonpharmacological recommendations to users ! It includes all our externally-facing APIs, and most of the services and storage models those APIs interact with.
In summary, you will do the following
-
Install the dependencies (python, docker, etc).
-
Choose and configure an IDE (we recommend either Pycharm or VScode).
- Amazon AWS Account to connect to the S3 Bucket
- Install local dependencies in the requirements.in file. Core dependencies are:
- homebrew A package manager that makes it easy to install stuff; use it if you do not care for installing each thing individually/mucking about with package dependencies; if you are not on Mac OS: Ubuntu - use apt-get instead. Windows - not sure.
- Docker
- Python. Make sure to download the right version for your CPU architecture. For M1 CPU Macbooks use arm64. For Intel, use amd64.
- git
- Kubectl
- the configuration folder contains the application properties and the prompt template
- the dto folder contains the data transfer object classes
- the service folder contains classes that handle the business logic of the application
- the main class serves as the entry point for the application
- the Dockerfile contains step-by-step instructions on how to create a Docker image from the application
Most likely you'll need to setup chroma locally on docker.
Read this doc for some tips and guidelines around using ChromaDB.
Run the application from the main file
Deployments are managed through Docker, and Kubectl. Kubernetes is hosted on AWS, alternatively, you can use any cloud provider of your choice
| Field | Description | Required | Example | Datatype |
|---|---|---|---|---|
| message | represents user's question | true | what is osteoporosis | string |
{ "message": "define osteoporosis in one sentence" }
{ "message": "Osteoporosis is a disease that causes low bone mass and deterioration in the microarchitecture." }
This endpoint handles refreshing and reloading the entire collection of doucments. It doesnt receive contain a request body and returns a 201. In the background it spins up an asynchronous thread to execute the task
201
| Field | Description | Required | Example | Datatype |
|---|---|---|---|---|
| fileName | represents the name of the file to be saved in the vector DB | true | pdf/2015_HealthyNutritionHealthyBones_ThematicReport_English.pdf | string |
{ "fileName": "pdf/2015_HealthyNutritionHealthyBones_ThematicReport_English.pdf" }