diff --git a/MinuteMate/README.md b/MinuteMate/README.md index 62b4ca45..b5557b93 100644 --- a/MinuteMate/README.md +++ b/MinuteMate/README.md @@ -8,29 +8,34 @@ ##### Back-end Components & Integrations -- **API Layer** - Exposes an API that the front end consumes -- **Query Preparation** - Extract keywords, get vector embeddings of prompt or parts of prompt, if necessary. The embedding model(s) used at this stage MUST match the embedding models of the database collections to be queried. +- **API Layer** - Exposes an API that the Streamlit front end consumes. Uses FastAPI. +- **Query Preparation** - Extract keywords, and get vector embeddings of prompt or parts of prompt, as necessary. The embedding model used to get vector embeddings at this stage MUST match the embedding models of the database collections to be queried or search results will be nonsense. - **Database Query** - Uses extracted keywords, vector embeddings, and/or other relevant information to get relevant chunks from the vector database, as provided by the preprocessing pipeline. - **Reranking & Filtering** - Selects resources for response, potentially using an external reranking service. - **Response Generation** - Generates a response, typically by sending a request to a generative model with the original user prompt and a system prompt including selected resources acquired from the vector database. - **Trust & Safety** - Two separate stages, each using an external generative model. The first stage examines only the incoming prompt. If an inappropriate prompt is detected at this stage, all ordinary steps are skipped and a response is sent declining the prompt. The second examines generated responses and vetoes those with inappropriate content. -##### Setup - Docker +##### Local Setup - Docker -In MinuteMate/back: +- Start [**Docker Desktop**](https://www.docker.com/products/docker-desktop/) -Set up secrets in a .env file according to .env.example +- In folder **MinuteMate/back**, create file '.env' according to .env.example with necessary secrets +- Deploy FastAPI back end: In the folder **MinuteMate/back**, run: ```bash docker compose --env-file .env up -d --build ``` -In MinuteMate/front: - +- Deploy Streamlit front end: In the folder **MinuteMate/front**, run: ```bash docker compose up -d --build ``` +- To interact with the Streamlit Open a web browser and navigate to localhost:8501 + +- To close the Streamlit app, ensure Streamlit is still open in the browser, then at the command line used to deploy Streamlit, press and hold ctrl-C for at least 3 second + +- Shut down and clean up by deleting your Docker Containers and Docker Images in Docker Desktop ##### Setup - Repo @@ -43,7 +48,7 @@ streamlit run app.py **Back-End ``` cd /MinuteMate/back/ -uvicorn main02:app --reload +uvicorn main:app --reload ``` diff --git a/MinuteMate/back/.env.example b/MinuteMate/back/.env.example index 7484b918..a179fe95 100644 --- a/MinuteMate/back/.env.example +++ b/MinuteMate/back/.env.example @@ -2,5 +2,5 @@ OPENAI_API_KEY = # Weaviate cloud deployment -WEAVIATE_URL = +WEAVIATE_ENDPOINT_URL = WEAVIATE_API_KEY = \ No newline at end of file diff --git a/MinuteMate/back/main_fn_new.py b/MinuteMate/back/main_fn_dev_new.py similarity index 100% rename from MinuteMate/back/main_fn_new.py rename to MinuteMate/back/main_fn_dev_new.py diff --git a/MinuteMate/back/main_fn.py b/MinuteMate/back/main_fn_dev_old.py similarity index 100% rename from MinuteMate/back/main_fn.py rename to MinuteMate/back/main_fn_dev_old.py diff --git a/MinuteMate/back/requirements.txt b/MinuteMate/back/requirements.txt index 7f5fa680..f846b224 100644 --- a/MinuteMate/back/requirements.txt +++ b/MinuteMate/back/requirements.txt @@ -1,22 +1,25 @@ -# NLP stuff +# NLP stuff for keyword search rake_nltk==1.0.6 nltk==3.9.1 -# Necessary for the API +# API framework fastapi[standard]==0.115.5 +# Handles data validation, parsing, error handling, +# conversions, and type hints # Necessary for the API -# Handles data validation, parsing, error handling, conversions, type hints pydantic==2.10.1 -# Necessary for web stuff +# Web server used by FastAPI uvicorn[standard]==0.32.1 -# vector database +# Weaviate vector database Python API weaviate-client==4.7.1 -# environmental variables such as API keys and endpoint URLs +# For loading environmental variables such as API +# keys and endpoint URLs python-dotenv==1.0.0 -# for running queries +# OpenAI Python API for interacting with generative +# and embedding models openai==1.54.3 \ No newline at end of file diff --git a/MinuteMate/front/requirements.txt b/MinuteMate/front/requirements.txt index 8d905b7f..93bf0fb9 100644 --- a/MinuteMate/front/requirements.txt +++ b/MinuteMate/front/requirements.txt @@ -1,4 +1,2 @@ - -streamlit - -pandas \ No newline at end of file +streamlit==1.40.1 +pandas==2.2.3 \ No newline at end of file