Skip to content

chore: Return explict None type for DELETE endpoints #2574

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

Merged
merged 1 commit into from
Aug 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/google/adk/cli/adk_web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,14 @@ async def create_session(
logger.info("New session created")
return session

@app.delete("/apps/{app_name}/users/{user_id}/sessions/{session_id}")
async def delete_session(
app_name: str, user_id: str, session_id: str
) -> None:
await self.session_service.delete_session(
app_name=app_name, user_id=user_id, session_id=session_id
)

@app.post(
"/apps/{app_name}/eval_sets/{eval_set_id}",
response_model_exclude_none=True,
Expand Down Expand Up @@ -606,7 +614,9 @@ async def update_eval(
"/apps/{app_name}/eval_sets/{eval_set_id}/evals/{eval_case_id}",
tags=[TAG_EVALUATION],
)
async def delete_eval(app_name: str, eval_set_id: str, eval_case_id: str):
async def delete_eval(
app_name: str, eval_set_id: str, eval_case_id: str
) -> None:
try:
self.eval_sets_manager.delete_eval_case(
app_name, eval_set_id, eval_case_id
Expand Down Expand Up @@ -733,12 +743,6 @@ async def list_eval_metrics(app_name: str) -> list[MetricInfo]:
status_code=400, detail=MISSING_EVAL_DEPENDENCIES_MESSAGE
) from e

@app.delete("/apps/{app_name}/users/{user_id}/sessions/{session_id}")
async def delete_session(app_name: str, user_id: str, session_id: str):
await self.session_service.delete_session(
app_name=app_name, user_id=user_id, session_id=session_id
)

@app.get(
"/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts/{artifact_name}",
response_model_exclude_none=True,
Expand Down Expand Up @@ -813,7 +817,7 @@ async def list_artifact_versions(
)
async def delete_artifact(
app_name: str, user_id: str, session_id: str, artifact_name: str
):
) -> None:
await self.artifact_service.delete_artifact(
app_name=app_name,
user_id=user_id,
Expand Down