refactor(agents-api): Rework routers to split routes into individual files #422
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #414
Refactors the
agents-api
routers by splitting route handlers into individual files and moving therouter = APIRouter()
object to__init__.py
in each directory.__init__.py
inagents
,sessions
, andusers
directories to initializeAPIRouter()
directly, removing the need to importrouter
fromrouters.py
.agents
,sessions
, andusers
directories, including operations likecreate
,delete
,update
,patch
,list
, andget_details
. Each file contains the necessary imports, dependencies, and route-specific logic.routers.py
files fromagents
,sessions
, andusers
directories, as their functionalities have been distributed across the new individual route handler files.For more details, open the Copilot Workspace session.
Summary:
Refactored
agents-api
routers by splitting route handlers into individual files and initializingAPIRouter
in__init__.py
foragents
,sessions
, andusers
directories.Key points:
agents-api/agents_api/routers/agents/__init__.py
,agents-api/agents_api/routers/sessions/__init__.py
, andagents-api/agents_api/routers/users/__init__.py
to initializeAPIRouter()
directly.agents
,sessions
, andusers
directories, including operations likecreate
,delete
,update
,patch
,list
, andget_details
.routers.py
files fromagents
,sessions
, andusers
directories.agents-api/agents_api/routers/agents/create_agent.py
,agents-api/agents_api/routers/agents/delete_agent.py
,agents-api/agents_api/routers/agents/get_agent_details.py
,agents-api/agents_api/routers/agents/list_agents.py
,agents-api/agents_api/routers/agents/patch_agent.py
,agents-api/agents_api/routers/agents/update_agent.py
now importrouter
fromrouter.py
and define their respective route handlers.Generated with ❤️ by ellipsis.dev