feat: add Streamlit UI for consent form compliance checking#39
Open
GovindhKishore wants to merge 13 commits intoga4gh:mainfrom
Open
feat: add Streamlit UI for consent form compliance checking#39GovindhKishore wants to merge 13 commits intoga4gh:mainfrom
GovindhKishore wants to merge 13 commits intoga4gh:mainfrom
Conversation
Author
|
Hi @dedyli. This PR adds optional Gemini support only for testing convenience since it provides a free API, making it easier for reviewers and contributors to run the pipeline. The production backend remains OpenAI as per project requirements, and the implementation ensures that Gemini is purely optional and does not affect the existing OpenAI-based workflow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
src/ui/app.py- a Streamlit frontend that exposes the full compliance pipeline to end users without requiring any CLI or code interaction.Closes #38
Changes
New files
src/ui/__init__.pysrc/ui/app.py- Streamlit frontendModified files
src/compliance/checker.pyextract_textupdated to accept either a file path string (CLI usage) or a BytesIO object (Streamlit usage). For BytesIO, usespypdf.PdfReaderdirectly instead ofPyPDFLoaderwhich requires a file path on disk.filenameparameter added to detect file type when BytesIO is passed.run_compliance_checksignature changed fromfile_path: strtoconsent_text: str.llmparameter made optional (llm=None) to support Gemini backend which does not use a LangChain LLM instance.UI behaviour
Testing
Tested manually end-to-end with Gemini 2.5 Flash using a made up pediatric rare disease consent form. 19 checks ran (8 universal + 11 conditional across
clinical_genomic,pediatric,rare_disease,large_scale). Verdicts and citations accurate against real GA4GH documents.Notes for reviewer
checker.pychanges are backward compatible -extract_textstill accepts file paths, existing CLI usage unchanged.requirements.txt. Production LLM remains OpenAI as specified in the project requirements.