zhaoqingang
2024-11-11 c1768114de381e37e272e9faf7db8e95a93ff381
main.py
@@ -1,6 +1,7 @@
from contextlib import asynccontextmanager
from fastapi import FastAPI
from app.Log import init_log
from app.api.auth import router as auth_router
from app.api.chat import router as chat_router
from app.api.agent import router as agent_router
@@ -9,6 +10,7 @@
from app.api.report import router as report_router
from app.api.user import user_router
from app.api.group import group_router
from app.api.role import role_router
from app.models.base_model import init_db
from app.task.fetch_agent import sync_agents, initialize_agents
@@ -32,6 +34,7 @@
    lifespan=lifespan
)
app.include_router(auth_router, prefix='/api/auth', tags=["auth"])
app.include_router(chat_router, prefix='/api/chat', tags=["chat"])
app.include_router(agent_router, prefix='/api/agent', tags=["agent"])
@@ -40,6 +43,7 @@
app.include_router(report_router, prefix='/api/report', tags=["report"])
app.include_router(user_router, prefix='/api/user', tags=["user"])
app.include_router(group_router, prefix='/api/group', tags=["group"])
app.include_router(role_router, prefix='/api/role', tags=["role"])
if __name__ == "__main__":
    import uvicorn