File size: 1,030 Bytes
a4a7b47
 
 
f673cee
 
 
 
a4a7b47
 
 
 
 
 
 
 
 
 
 
4759971
 
 
 
 
a4a7b47
 
4759971
a4a7b47
 
4759971
a4a7b47
 
 
 
 
 
 
4759971
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
# Import all components from both files
from general_rag import app, models, data
from medical_rag import *
from fastapi import FastAPI
import uvicorn
from general_rag import load_models
from medical_rag import load_medical_models

# Initialize all components
def initialize_app():
    # Load general models and data
    general_success = load_models() and load_data()
    
    # Load medical-specific models
    medical_success = load_medical_models()
    
    return general_success and medical_success


@app.get("/")
async def root():
    return {"message": "Welcome to TeaRAG! Your Medical Assistant Powered by RAG"}

@app.get("/health")
async def health_check():
    """Health check endpoint"""
    status = {
        'status': 'healthy',
        'models_loaded': bool(models),
        'embeddings_loaded': bool(data.get('embeddings')),
        'documents_loaded': not data.get('df', pd.DataFrame()).empty
    }
    return status

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=7860)