Skip to content

Commit ecaa7b4

Browse files
DeanChensjcopybara-github
authored andcommitted
chore: Rename run related method and request to align with the conventions
PiperOrigin-RevId: 795660109
1 parent 279e4fe commit ecaa7b4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/google/adk/cli/adk_web_server.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def clear(self):
155155
self._spans.clear()
156156

157157

158-
class AgentRunRequest(common.BaseModel):
158+
class RunAgentRequest(common.BaseModel):
159159
app_name: str
160160
user_id: str
161161
session_id: str
@@ -822,15 +822,13 @@ async def delete_artifact(
822822
)
823823

824824
@app.post("/run", response_model_exclude_none=True)
825-
async def agent_run(req: AgentRunRequest) -> list[Event]:
825+
async def run_agent(req: RunAgentRequest) -> list[Event]:
826826
session = await self.session_service.get_session(
827827
app_name=req.app_name, user_id=req.user_id, session_id=req.session_id
828828
)
829829
if not session:
830830
raise HTTPException(status_code=404, detail="Session not found")
831831
runner = await self.get_runner_async(req.app_name)
832-
833-
events = []
834832
async with Aclosing(
835833
runner.run_async(
836834
user_id=req.user_id,
@@ -844,7 +842,7 @@ async def agent_run(req: AgentRunRequest) -> list[Event]:
844842
return events
845843

846844
@app.post("/run_sse")
847-
async def agent_run_sse(req: AgentRunRequest) -> StreamingResponse:
845+
async def run_agent_sse(req: RunAgentRequest) -> StreamingResponse:
848846
# SSE endpoint
849847
session = await self.session_service.get_session(
850848
app_name=req.app_name, user_id=req.user_id, session_id=req.session_id
@@ -938,7 +936,7 @@ async def get_event_graph(
938936
return {}
939937

940938
@app.websocket("/run_live")
941-
async def agent_live_run(
939+
async def run_agent_live(
942940
websocket: WebSocket,
943941
app_name: str,
944942
user_id: str,

0 commit comments

Comments
 (0)