Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
creatorrr opened this issue Jun 30, 2024 · 0 comments · Fixed by #422
Closed

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

creatorrr opened this issue Jun 30, 2024 · 0 comments · Fixed by #422

Comments

@creatorrr
Copy link
Contributor

creatorrr commented Jun 30, 2024

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/*`
@creatorrr creatorrr changed the title Refactor routers to split routes into individual files refactor(agents-api): Break up */routers.py to split routes into individual files Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant