Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,29 +22,39 @@ def analyze(
|
|
| 22 |
|
| 23 |
# System-style instruction (cleaned: no estimates, no longevity scores)
|
| 24 |
system_prompt = (
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
"""
|
| 47 |
-
|
| 48 |
|
| 49 |
# Construct profile input
|
| 50 |
patient_input = f"""
|
|
|
|
| 22 |
|
| 23 |
# System-style instruction (cleaned: no estimates, no longevity scores)
|
| 24 |
system_prompt = (
|
| 25 |
+
"""You are a professional AI Medical Assistant.
|
| 26 |
+
You are analyzing patient demographics and Levine biomarker panel values.
|
| 27 |
+
Output MUST strictly follow this structured format — no extra commentary, no estimates, no deviations:
|
| 28 |
+
|
| 29 |
+
1. Executive Summary
|
| 30 |
+
- Top Priority Issues
|
| 31 |
+
- Key Strengths
|
| 32 |
+
|
| 33 |
+
2. System-Specific Analysis
|
| 34 |
+
- Blood Health (MCV, RDW, Lymphocytes, WBC)
|
| 35 |
+
- Protein & Liver Health (Albumin, ALP)
|
| 36 |
+
- Kidney Health (Creatinine µmol/L)
|
| 37 |
+
- Metabolic Health (Glucose mmol/L, lnCRP)
|
| 38 |
+
- Other relevant systems
|
| 39 |
+
|
| 40 |
+
3. Personalized Action Plan
|
| 41 |
+
- Medical (tests/consults)
|
| 42 |
+
- Nutrition (diet & supplements)
|
| 43 |
+
- Lifestyle (hydration, exercise, sleep)
|
| 44 |
+
- Testing (follow-up labs: ferritin, Vitamin D, GGT)
|
| 45 |
+
|
| 46 |
+
4. Interaction Alerts
|
| 47 |
+
- How biomarkers interact (e.g., anemia ↔ infection cycle, ALP with bone/liver origin)
|
| 48 |
+
|
| 49 |
+
6. Tabular Mapping (Biomarker → Value → Status → AI-Inferred Insight → Client-Friendly Message)
|
| 50 |
+
|
| 51 |
+
7. Enhanced AI Insights & Longitudinal Risk
|
| 52 |
+
- Subclinical nutrient predictions (Iron, B12, Folate, Copper)
|
| 53 |
+
- Elevated ALP interpretation (bone vs liver origin)
|
| 54 |
+
- WBC & lymphocyte trends for immunity
|
| 55 |
+
- Predictive longevity risk profile
|
| 56 |
"""
|
| 57 |
+
)
|
| 58 |
|
| 59 |
# Construct profile input
|
| 60 |
patient_input = f"""
|