Spaces:
Sleeping
Sleeping
File size: 1,259 Bytes
c899329 bd5a98c 4a7a05f c899329 f7f0991 d091eda c899329 4a7a05f c899329 4a7a05f c899329 0f6ea9a bd5a98c 4a7a05f bd5a98c 4a7a05f bd5a98c c899329 f7f0991 |
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 |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from datetime import datetime
from api_routes.chat_api import router as chat_router
from api_routes.knowledge_base_api import router as knowledge_base_router
from api_routes.chat_history_supabase_api import router as chat_history_router
description = (
"Yuvabe Care Companion AI is designed to provide helpful and accurate "
"responses to health-related queries. It offers insights from curated "
"knowledge bases and maintains chat history for improved user experience."
)
app = FastAPI(
title="Yuvabe Care Companion AI",
description=description,
version="1.0.0",
)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["*"],
allow_headers=["*"],
expose_headers=["Cache-Control"],
)
@app.get("/", tags=["Root"], summary="Root Endpoint", response_model=dict)
def read_root():
"""Health check endpoint for confirming the API is active."""
return {
"message": "Yuvabe Care Companion AI is running successfully.",
"timestamp": datetime.now().isoformat()
}
# Register Routes
app.include_router(chat_router)
app.include_router(knowledge_base_router)
app.include_router(chat_history_router)
|