Skip to content

nuna-aa/chatbot-recommendation-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Non-pharmacological recommendation system using Large Language Models

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

Setup

Prerequisites

  • 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

IDE setup

Setup your preferred IDE either pycharm or VSCode

  • 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

Chroma Database setup

Most likely you'll need to setup chroma locally on docker.

Read this doc for some tips and guidelines around using ChromaDB.

Running tests

Run the application from the main file

Deployment

Deployments are managed through Docker, and Kubectl. Kubernetes is hosted on AWS, alternatively, you can use any cloud provider of your choice

API and Component Documentation

1. The /chat endpoint

Specification

Field Description Required Example Datatype
message represents user's question true what is osteoporosis string

Request Example

{ "message": "define osteoporosis in one sentence" }

Response Example

{ "message": "Osteoporosis is a disease that causes low bone mass and deterioration in the microarchitecture." }

2. The /chat/data/reload endpoint

Specification

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

Response Example

201

2. The /chat/data/insert endpoint

Specification

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

Request Example

{ "fileName": "pdf/2015_HealthyNutritionHealthyBones_ThematicReport_English.pdf" }

About

Recommendation Chatbot Engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published