🚀 feat(api): add versioning to the API and restructure the router

The API now has versioning, with the prefix "/api/v1". The router has been restructured to include the chat, endpoints, and validate routers. This improves the organization of the code and makes it easier to add new routers in the future.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-06 10:00:38 -03:00
commit bdbb4a8127
3 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,3 @@
from langflow.api.router import router
__all__ = ["router"]

View file

@ -0,0 +1,8 @@
# Router for base api
from fastapi import APIRouter
from langflow.api.v1 import chat_router, endpoints_router, validate_router
router = APIRouter(prefix="/api/v1", tags=["api"])
router.include_router(chat_router)
router.include_router(endpoints_router)
router.include_router(validate_router)

View file

@ -0,0 +1,5 @@
from langflow.api.v1.endpoints import router as endpoints_router
from langflow.api.v1.validate import router as validate_router
from langflow.api.v1.chat import router as chat_router
__all__ = ["chat_router", "endpoints_router", "validate_router"]