Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
import uvicorn
|
2 |
from fastapi import FastAPI
|
3 |
from fastapi.middleware.cors import CORSMiddleware
|
4 |
-
from config import setup_app
|
5 |
-
from endpoints import
|
6 |
|
7 |
# Create the FastAPI app
|
8 |
app = FastAPI(title="TxAgent API", version="2.6.0")
|
@@ -16,11 +16,12 @@ app.add_middleware(
|
|
16 |
allow_headers=["*"]
|
17 |
)
|
18 |
|
19 |
-
# Include the router with endpoints
|
20 |
-
app.include_router(router)
|
21 |
-
|
22 |
# Setup the app (e.g., initialize globals, startup event)
|
23 |
setup_app(app)
|
24 |
|
|
|
|
|
|
|
|
|
25 |
if __name__ == "__main__":
|
26 |
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
|
1 |
import uvicorn
|
2 |
from fastapi import FastAPI
|
3 |
from fastapi.middleware.cors import CORSMiddleware
|
4 |
+
from config import setup_app, agent, logger, patients_collection, analysis_collection
|
5 |
+
from endpoints import create_router
|
6 |
|
7 |
# Create the FastAPI app
|
8 |
app = FastAPI(title="TxAgent API", version="2.6.0")
|
|
|
16 |
allow_headers=["*"]
|
17 |
)
|
18 |
|
|
|
|
|
|
|
19 |
# Setup the app (e.g., initialize globals, startup event)
|
20 |
setup_app(app)
|
21 |
|
22 |
+
# Create and include the router with dependencies
|
23 |
+
router = create_router(agent, logger, patients_collection, analysis_collection)
|
24 |
+
app.include_router(router)
|
25 |
+
|
26 |
if __name__ == "__main__":
|
27 |
uvicorn.run(app, host="0.0.0.0", port=8000)
|