A curated collection of practical AI projects implementing OCR systems, RAG, AI agents, and other AI use cases.
audit: fix clinical_rag_with_ade - add env comments, add tagline, add docstrings, replace print with logging
Tiioluwanifc97f44ed3fe
diff --git a/rag_apps/clinical_rag_with_ade/.env.example b/rag_apps/clinical_rag_with_ade/.env.exampleindex 35f53be..84dfe4f 100644--- a/rag_apps/clinical_rag_with_ade/.env.example+++ b/rag_apps/clinical_rag_with_ade/.env.example@@ -1,2 +1,7 @@+# LandingAI API key used for Agentic Document Extraction (ADE) parsing.+# Get one at https://va.landing.ai/my/settings/api-keyVISION_AGENT_API_KEY=your_landingai_key_here++# Mistral AI API key used for embeddings (mistral-embed) and reasoning (mistral-large-latest).+# Get one at https://console.mistral.ai/MISTRAL_API_KEY=your_mistral_key_here\ No newline at end of filediff --git a/rag_apps/clinical_rag_with_ade/README.md b/rag_apps/clinical_rag_with_ade/README.mdindex 10e4bd6..dc92881 100644--- a/rag_apps/clinical_rag_with_ade/README.md+++ b/rag_apps/clinical_rag_with_ade/README.md@@ -1,4 +1,7 @@# 🏥 Clinical RAG with ADE++> Query dense clinical PDFs and get answers grounded in the document's exact visual layout.+## Overviewdiff --git a/rag_apps/clinical_rag_with_ade/app.py b/rag_apps/clinical_rag_with_ade/app.pyindex 919f4e2..7289f00 100644--- a/rag_apps/clinical_rag_with_ade/app.py+++ b/rag_apps/clinical_rag_with_ade/app.py@@ -1,3 +1,4 @@+"""Streamlit dashboard for uploading clinical PDFs and querying them with visually grounded RAG."""import streamlit as stimport osfrom processor import ClinicalRAGProcessordiff --git a/rag_apps/clinical_rag_with_ade/main.py b/rag_apps/clinical_rag_with_ade/main.pyindex 40fa6b3..07171fa 100644--- a/rag_apps/clinical_rag_with_ade/main.py+++ b/rag_apps/clinical_rag_with_ade/main.py@@ -1,3 +1,6 @@+"""Placeholder entry point generated by the uv project scaffold; the app runs via app.py."""++def main():print("Hello from clinical-rag-with-ade!")diff --git a/rag_apps/clinical_rag_with_ade/processor.py b/rag_apps/clinical_rag_with_ade/processor.pyindex 8feac52..5a8ed07 100644--- a/rag_apps/clinical_rag_with_ade/processor.py+++ b/rag_apps/clinical_rag_with_ade/processor.py@@ -1,3 +1,4 @@+import loggingimport osimport shutilfrom pathlib import Path@@ -14,6 +15,8 @@ from langchain_core.documents import Documentload_dotenv()+logger = logging.getLogger(__name__)+class ClinicalRAGProcessor:def __init__(self, db_path="./chroma_db"):"""@@ -33,7 +36,7 @@ class ClinicalRAGProcessor:Parses a PDF using ADE and indexes structured chunks into ChromaDB.Returns the number of chunks indexed."""- print(f"--- ADE Parsing Started: {file_path} ---")+ logger.info("ADE parsing started: %s", file_path)# ADE expects a pathlib.Path object for local file parsingresponse = self.ade_client.parse(@@ -120,4 +123,4 @@ class ClinicalRAGProcessor:if os.path.exists(self.db_path):shutil.rmtree(self.db_path)self.vector_store = None- print(f"Database at {self.db_path} has been wiped.")\ No newline at end of file+ logger.info("Database at %s has been wiped.", self.db_path)\ No newline at end of file