Spaces:
Runtime error
Runtime error
Upgrade Gradio to fix Pydantic 2 conflict
Browse files- .pytest_cache/.gitignore +2 -0
- .pytest_cache/CACHEDIR.TAG +4 -0
- .pytest_cache/README.md +8 -0
- .pytest_cache/v/cache/lastfailed +1 -0
- .pytest_cache/v/cache/nodeids +13 -0
- README_HF.md +1 -28
- app.py +1 -1
- backend/gradio_app.py +1 -2
- requirements.txt +13 -13
.pytest_cache/.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Created by pytest automatically.
|
| 2 |
+
*
|
.pytest_cache/CACHEDIR.TAG
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Signature: 8a477f597d28d172789f06886806bc55
|
| 2 |
+
# This file is a cache directory tag created by pytest.
|
| 3 |
+
# For information about cache directory tags, see:
|
| 4 |
+
# https://bford.info/cachedir/spec.html
|
.pytest_cache/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# pytest cache directory #
|
| 2 |
+
|
| 3 |
+
This directory contains data from the pytest's cache plugin,
|
| 4 |
+
which provides the `--lf` and `--ff` options, as well as the `cache` fixture.
|
| 5 |
+
|
| 6 |
+
**Do not** commit this to version control.
|
| 7 |
+
|
| 8 |
+
See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information.
|
.pytest_cache/v/cache/lastfailed
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{}
|
.pytest_cache/v/cache/nodeids
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
"tests/test_patient_sim.py::test_cardiac_population",
|
| 3 |
+
"tests/test_patient_sim.py::test_cohort_stress_test_warfarin",
|
| 4 |
+
"tests/test_patient_sim.py::test_generate_cohort_basic",
|
| 5 |
+
"tests/test_patient_sim.py::test_patient_structure",
|
| 6 |
+
"tests/test_protocol_rag.py::test_age_violation",
|
| 7 |
+
"tests/test_protocol_rag.py::test_amendment_structure",
|
| 8 |
+
"tests/test_protocol_rag.py::test_check_patient_against_criteria",
|
| 9 |
+
"tests/test_protocol_rag.py::test_check_patient_logic",
|
| 10 |
+
"tests/test_protocol_rag.py::test_extract_criteria_mock",
|
| 11 |
+
"tests/test_protocol_rag.py::test_patient_passes_criteria",
|
| 12 |
+
"tests/test_protocol_rag.py::test_patient_passes_criteria_logic"
|
| 13 |
+
]
|
README_HF.md
CHANGED
|
@@ -10,31 +10,4 @@ pinned: false
|
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
**Autonomous Trial Safety & Feasibility Agent for Clinical Trials**
|
| 16 |
-
|
| 17 |
-
Built for the MCP 1st Birthday Hackathon, TrialAURA uses three Model Context Protocol (MCP) servers to provide comprehensive clinical trial safety analysis:
|
| 18 |
-
|
| 19 |
-
## Features
|
| 20 |
-
|
| 21 |
-
- 馃搫 **Protocol Parsing** (LlamaIndex + Gemini): Extract eligibility criteria from trial protocols
|
| 22 |
-
- 馃懃 **Synthetic Cohorts** (Faker): Generate realistic patient populations for stress-testing
|
| 23 |
-
- 鈿狅笍 **Safety Analysis**: Detect eligibility violations and safety risks
|
| 24 |
-
- 馃摑 **Amendment Drafting** (Gemini): Produce regulatory-style protocol amendments
|
| 25 |
-
- 馃攧 **Recurring Scans** (Blaxel): Schedule automated safety monitoring
|
| 26 |
-
|
| 27 |
-
## Architecture
|
| 28 |
-
|
| 29 |
-
Three MCP servers working together:
|
| 30 |
-
1. **Protocol RAG MCP** - Document parsing and criteria extraction
|
| 31 |
-
2. **Patient Sim MCP** - Synthetic cohort generation
|
| 32 |
-
3. **Safety Ops MCP** - Workflow orchestration and monitoring
|
| 33 |
-
|
| 34 |
-
## Safety Notice
|
| 35 |
-
|
| 36 |
-
鈿狅笍 All patients are **synthetic** and used purely for safety simulation. This agent operates in a simulation context only and never provides medical advice to real patients.
|
| 37 |
-
|
| 38 |
-
---
|
| 39 |
-
|
| 40 |
-
**Built with**: Gemini API 路 LlamaIndex 路 Gradio 路 MCP
|
|
|
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -12,4 +12,4 @@ sys.path.append(str(Path(__file__).parent / "backend"))
|
|
| 12 |
from backend.gradio_app import app
|
| 13 |
|
| 14 |
if __name__ == "__main__":
|
| 15 |
-
app.
|
|
|
|
| 12 |
from backend.gradio_app import app
|
| 13 |
|
| 14 |
if __name__ == "__main__":
|
| 15 |
+
app.launch(server_name="0.0.0.0", server_port=7860)
|
backend/gradio_app.py
CHANGED
|
@@ -279,8 +279,7 @@ with app:
|
|
| 279 |
gr.Markdown("### Artifacts")
|
| 280 |
|
| 281 |
artifact_viewer = gr.JSON(
|
| 282 |
-
label="Current Artifact"
|
| 283 |
-
value={}
|
| 284 |
)
|
| 285 |
|
| 286 |
# Event handler
|
|
|
|
| 279 |
gr.Markdown("### Artifacts")
|
| 280 |
|
| 281 |
artifact_viewer = gr.JSON(
|
| 282 |
+
label="Current Artifact"
|
|
|
|
| 283 |
)
|
| 284 |
|
| 285 |
# Event handler
|
requirements.txt
CHANGED
|
@@ -1,21 +1,21 @@
|
|
| 1 |
# Core - HF Spaces compatible
|
| 2 |
-
gradio
|
| 3 |
-
huggingface-hub
|
| 4 |
-
|
| 5 |
-
# MCP and pydantic - compatible versions
|
| 6 |
-
mcp>=0.9.0
|
| 7 |
pydantic>=2.0.0,<3.0.0
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
# Google
|
|
|
|
|
|
|
|
|
|
| 10 |
google-generativeai>=0.3.0
|
|
|
|
| 11 |
|
| 12 |
-
# Patient simulation
|
| 13 |
faker>=20.0.0
|
| 14 |
-
pandas>=2.0.0
|
| 15 |
numpy>=1.24.0,<2.0.0
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
# Utils
|
| 21 |
-
python-dotenv>=1.0.0
|
|
|
|
| 1 |
# Core - HF Spaces compatible
|
| 2 |
+
gradio>=5.0.0
|
| 3 |
+
huggingface-hub>=0.25.0
|
|
|
|
|
|
|
|
|
|
| 4 |
pydantic>=2.0.0,<3.0.0
|
| 5 |
+
mcp>=0.9.0
|
| 6 |
+
python-dotenv>=1.0.0
|
| 7 |
|
| 8 |
+
# Protocol RAG - LlamaIndex with Google GenAI
|
| 9 |
+
llama-index-core>=0.13.0
|
| 10 |
+
llama-index-llms-google-genai
|
| 11 |
+
llama-index-embeddings-google-genai
|
| 12 |
google-generativeai>=0.3.0
|
| 13 |
+
pypdf2>=3.0.0
|
| 14 |
|
| 15 |
+
# Patient simulation
|
| 16 |
faker>=20.0.0
|
| 17 |
+
pandas>=2.0.0,<3.0.0
|
| 18 |
numpy>=1.24.0,<2.0.0
|
| 19 |
|
| 20 |
+
# Optional
|
| 21 |
+
modal>=0.63.0
|
|
|
|
|
|
|
|
|