Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ from bloatectomy import bloatectomy
|
|
| 13 |
from werkzeug.utils import secure_filename
|
| 14 |
from langchain_groq import ChatGroq
|
| 15 |
from typing_extensions import TypedDict, NotRequired
|
| 16 |
-
|
| 17 |
# --- Logging ---
|
| 18 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
| 19 |
logger = logging.getLogger("patient-assistant")
|
|
@@ -133,7 +133,7 @@ def extract_json_from_llm_response(raw_response: str) -> dict:
|
|
| 133 |
def serve_frontend():
|
| 134 |
"""Serves the frontend HTML file."""
|
| 135 |
try:
|
| 136 |
-
return app.send_static_file("
|
| 137 |
except Exception:
|
| 138 |
return "<h3>frontend2.html not found in static/ — please add your frontend2.html there.</h3>", 404
|
| 139 |
|
|
@@ -358,6 +358,7 @@ def upload_reports():
|
|
| 358 |
logger.exception("Upload failed: %s", exc)
|
| 359 |
return jsonify({"error": "upload failed", "detail": str(exc)}), 500
|
| 360 |
|
|
|
|
| 361 |
@app.route("/ping", methods=["GET"])
|
| 362 |
def ping():
|
| 363 |
return jsonify({"status": "ok"})
|
|
|
|
| 13 |
from werkzeug.utils import secure_filename
|
| 14 |
from langchain_groq import ChatGroq
|
| 15 |
from typing_extensions import TypedDict, NotRequired
|
| 16 |
+
|
| 17 |
# --- Logging ---
|
| 18 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
| 19 |
logger = logging.getLogger("patient-assistant")
|
|
|
|
| 133 |
def serve_frontend():
|
| 134 |
"""Serves the frontend HTML file."""
|
| 135 |
try:
|
| 136 |
+
return app.send_static_file("frontend_p.html")
|
| 137 |
except Exception:
|
| 138 |
return "<h3>frontend2.html not found in static/ — please add your frontend2.html there.</h3>", 404
|
| 139 |
|
|
|
|
| 358 |
logger.exception("Upload failed: %s", exc)
|
| 359 |
return jsonify({"error": "upload failed", "detail": str(exc)}), 500
|
| 360 |
|
| 361 |
+
|
| 362 |
@app.route("/ping", methods=["GET"])
|
| 363 |
def ping():
|
| 364 |
return jsonify({"status": "ok"})
|