julep-ai/julep

refactor(agents-api): Break up */routers.py to split routes into individual files

Closed this issue · 0 comments

The routers in agents-api/agents_api/routers/*/routers.py are large single files with handlers for various routes. We should refactor them by splitting the files up into directories where each file contains only a single route. For example, in agents-api/agents_api/routers/agents/routers.py:

  • move the router = AppRouter() object to __init__.py
  • split up the different routes and their imports into individual files
  • so, in a file named get_user_details.py, move:
    @router.get("/users/{user_id}", tags=["users"])
    

async def get_user_details(
user_id: UUID4,
x_developer_id: Annotated[UUID4, Depends(get_developer_id)],
) -> User:

Do the above for `routers/agents/*`, `routers/sessions/*`, and `routers/users/*`