Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
app.py
|
| 4 |
-
Universal AI Data Analyst with:
|
| 5 |
-
- Unchanged analysis & assessment logic
|
| 6 |
-
- Fixed Gradio event wiring (uses gr.State for history)
|
| 7 |
-
- Triple-quoted progress strings (no unterminated literals)
|
| 8 |
-
- Sleek full-width UI and Voice-to-Text (browser Web Speech API)
|
| 9 |
-
- Optional HIPAA flags (fallback defaults if not present in settings.py)
|
| 10 |
from future import annotations
|
| 11 |
import io
|
| 12 |
import json
|
|
@@ -26,7 +26,7 @@ COHERE_MODEL_PRIMARY,
|
|
| 26 |
COHERE_TIMEOUT_S, # noqa: F401
|
| 27 |
USE_OPEN_FALLBACKS # noqa: F401
|
| 28 |
)
|
| 29 |
-
Try to import optional HIPAA flags; fall back to safe defaults if not defined.
|
| 30 |
try:
|
| 31 |
from settings import PHI_MODE, PERSIST_HISTORY, HISTORY_TTL_DAYS, REDACT_BEFORE_LLM, ALLOW_EXTERNAL_PHI
|
| 32 |
except Exception:
|
|
@@ -38,7 +38,7 @@ ALLOW_EXTERNAL_PHI = True
|
|
| 38 |
from audit_log import log_event
|
| 39 |
from privacy import safety_filter, refusal_reply
|
| 40 |
from llm_router import cohere_chat, _co_client, cohere_embed
|
| 41 |
-
---------------------- Helpers (analysis logic unchanged) ----------------------
|
| 42 |
def load_markdown_text(filepath: str) -> str:
|
| 43 |
try:
|
| 44 |
with open(filepath, "r", encoding="utf-8") as f:
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
#app.py
|
| 4 |
+
# Universal AI Data Analyst with:
|
| 5 |
+
# - Unchanged analysis & assessment logic
|
| 6 |
+
# - Fixed Gradio event wiring (uses gr.State for history)
|
| 7 |
+
# - Triple-quoted progress strings (no unterminated literals)
|
| 8 |
+
# - Sleek full-width UI and Voice-to-Text (browser Web Speech API)
|
| 9 |
+
# - Optional HIPAA flags (fallback defaults if not present in settings.py)
|
| 10 |
from future import annotations
|
| 11 |
import io
|
| 12 |
import json
|
|
|
|
| 26 |
COHERE_TIMEOUT_S, # noqa: F401
|
| 27 |
USE_OPEN_FALLBACKS # noqa: F401
|
| 28 |
)
|
| 29 |
+
# Try to import optional HIPAA flags; fall back to safe defaults if not defined.
|
| 30 |
try:
|
| 31 |
from settings import PHI_MODE, PERSIST_HISTORY, HISTORY_TTL_DAYS, REDACT_BEFORE_LLM, ALLOW_EXTERNAL_PHI
|
| 32 |
except Exception:
|
|
|
|
| 38 |
from audit_log import log_event
|
| 39 |
from privacy import safety_filter, refusal_reply
|
| 40 |
from llm_router import cohere_chat, _co_client, cohere_embed
|
| 41 |
+
# ---------------------- Helpers (analysis logic unchanged) ----------------------
|
| 42 |
def load_markdown_text(filepath: str) -> str:
|
| 43 |
try:
|
| 44 |
with open(filepath, "r", encoding="utf-8") as f:
|