-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
56 lines (49 loc) · 1.63 KB
/
Copy pathrun.py
File metadata and controls
56 lines (49 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
50
51
52
53
54
55
"""
Medical RAG Assistant - Production Entry Point
Run with: python run.py
"""
from app import create_app
import logging
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
# Create Flask app using factory pattern
app = create_app()
# Print startup info
print("=" * 80)
print("🏥 MEDICAL RAG ASSISTANT - Production Backend")
print("=" * 80)
print(f"Server starting on http://localhost:5002")
print("")
print("📡 Available Endpoints:")
print(" GET / - Frontend UI")
print(" GET /health - Health check")
print(" POST /session/create - Create session")
print(" POST /chat - Send query (7-Step RAG)")
print(" GET /session/history - Get history")
print(" POST /session/reset - Reset session")
print(" DELETE /session/delete - Delete session")
print(" GET /stats - System stats")
print("")
print("🔬 Pipeline Features:")
print(" ✅ 7-Step RAG Pipeline")
print(" ✅ Cosine Similarity Search (FAISS Engine)")
print(" ✅ Evidence Gap Detection")
print(" ✅ Web Search Fallback")
print(" ✅ Safety Guardrails (Decorator Pattern)")
print(" ✅ Multi-Turn Conversations")
print(" ✅ Pydantic Validation")
print("")
print("⚡ Powered by Stitch")
print("=" * 80)
# Run server
app.run(
debug=True,
host='0.0.0.0',
port=5002,
threaded=True
)