2222# Import monitoring utilities
2323from utils .monitoring import monitoring_manager
2424
25- router = APIRouter (prefix = "/agent" )
25+ agent_runtime_router = APIRouter (prefix = "/agent" )
26+ agent_config_router = APIRouter (prefix = "/agent" )
2627logger = logging .getLogger ("agent_app" )
2728
2829
2930# Define API route
30- @router .post ("/run" )
31+ @agent_runtime_router .post ("/run" )
3132@monitoring_manager .monitor_endpoint ("agent.run" , exclude_params = ["authorization" ])
3233async def agent_run_api (agent_request : AgentRequest , http_request : Request , authorization : str = Header (None )):
3334 """
@@ -45,7 +46,7 @@ async def agent_run_api(agent_request: AgentRequest, http_request: Request, auth
4546 status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = "Agent run error." )
4647
4748
48- @router .get ("/stop/{conversation_id}" )
49+ @agent_runtime_router .get ("/stop/{conversation_id}" )
4950async def agent_stop_api (conversation_id : int , authorization : Optional [str ] = Header (None )):
5051 """
5152 stop agent run and preprocess tasks for specified conversation_id
@@ -58,7 +59,7 @@ async def agent_stop_api(conversation_id: int, authorization: Optional[str] = He
5859 detail = f"no running agent or preprocess tasks found for conversation_id { conversation_id } " )
5960
6061
61- @router .post ("/search_info" )
62+ @agent_config_router .post ("/search_info" )
6263async def search_agent_info_api (agent_id : int = Body (...), authorization : Optional [str ] = Header (None )):
6364 """
6465 Search agent info by agent_id
@@ -72,7 +73,7 @@ async def search_agent_info_api(agent_id: int = Body(...), authorization: Option
7273 status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = "Agent search info error." )
7374
7475
75- @router .get ("/get_creating_sub_agent_id" )
76+ @agent_config_router .get ("/get_creating_sub_agent_id" )
7677async def get_creating_sub_agent_info_api (authorization : Optional [str ] = Header (None )):
7778 """
7879 Create a new sub agent, return agent_ID
@@ -85,7 +86,7 @@ async def get_creating_sub_agent_info_api(authorization: Optional[str] = Header(
8586 status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = "Agent create error." )
8687
8788
88- @router .post ("/update" )
89+ @agent_config_router .post ("/update" )
8990async def update_agent_info_api (request : AgentInfoRequest , authorization : Optional [str ] = Header (None )):
9091 """
9192 Update an existing agent
@@ -99,7 +100,7 @@ async def update_agent_info_api(request: AgentInfoRequest, authorization: Option
99100 status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = "Agent update error." )
100101
101102
102- @router .delete ("" )
103+ @agent_config_router .delete ("" )
103104async def delete_agent_api (request : AgentIDRequest , authorization : Optional [str ] = Header (None )):
104105 """
105106 Delete an agent
@@ -113,7 +114,7 @@ async def delete_agent_api(request: AgentIDRequest, authorization: Optional[str]
113114 status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = "Agent delete error." )
114115
115116
116- @router .post ("/export" )
117+ @agent_config_router .post ("/export" )
117118async def export_agent_api (request : AgentIDRequest , authorization : Optional [str ] = Header (None )):
118119 """
119120 export an agent
@@ -127,7 +128,7 @@ async def export_agent_api(request: AgentIDRequest, authorization: Optional[str]
127128 status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = "Agent export error." )
128129
129130
130- @router .post ("/import" )
131+ @agent_config_router .post ("/import" )
131132async def import_agent_api (request : AgentImportRequest , authorization : Optional [str ] = Header (None )):
132133 """
133134 import an agent
@@ -141,7 +142,7 @@ async def import_agent_api(request: AgentImportRequest, authorization: Optional[
141142 status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = "Agent import error." )
142143
143144
144- @router .get ("/list" )
145+ @agent_config_router .get ("/list" )
145146async def list_all_agent_info_api (authorization : Optional [str ] = Header (None ), request : Request = None ):
146147 """
147148 list all agent info
@@ -155,7 +156,7 @@ async def list_all_agent_info_api(authorization: Optional[str] = Header(None), r
155156 status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = "Agent list error." )
156157
157158
158- @router .get ("/call_relationship/{agent_id}" )
159+ @agent_config_router .get ("/call_relationship/{agent_id}" )
159160async def get_agent_call_relationship_api (agent_id : int , authorization : Optional [str ] = Header (None )):
160161 """
161162 Get agent call relationship tree including tools and sub-agents
0 commit comments