Skip to content

Commit

Permalink
Clarified docs for chat app, fixed error in .env.example
Browse files Browse the repository at this point in the history
  • Loading branch information
neal-logan committed Nov 24, 2024
1 parent eb9abe5 commit c99136b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
21 changes: 13 additions & 8 deletions MinuteMate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -43,7 +48,7 @@ streamlit run app.py
**Back-End
```
cd /MinuteMate/back/
uvicorn main02:app --reload
uvicorn main:app --reload
```


2 changes: 1 addition & 1 deletion MinuteMate/back/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
OPENAI_API_KEY =

# Weaviate cloud deployment
WEAVIATE_URL =
WEAVIATE_ENDPOINT_URL =
WEAVIATE_API_KEY =
File renamed without changes.
File renamed without changes.
17 changes: 10 additions & 7 deletions MinuteMate/back/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
6 changes: 2 additions & 4 deletions MinuteMate/front/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@

streamlit

pandas
streamlit==1.40.1
pandas==2.2.3

0 comments on commit c99136b

Please sign in to comment.