From b4d44ab6b80b13381b5db0e3fbaba84997b3f74f Mon Sep 17 00:00:00 2001 From: Dylan Snyder <114695692+dylan-apex@users.noreply.github.com> Date: Wed, 20 Aug 2025 18:52:12 -0500 Subject: [PATCH 1/3] fix: add a2a endpoints --- src/google/adk/cli/fast_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/google/adk/cli/fast_api.py b/src/google/adk/cli/fast_api.py index 7d93b54360..7ec2a2577b 100644 --- a/src/google/adk/cli/fast_api.py +++ b/src/google/adk/cli/fast_api.py @@ -309,8 +309,9 @@ async def get_agent_builder(app_name: str, file_path: Optional[str] = None): from a2a.server.apps import A2AStarletteApplication from a2a.server.request_handlers import DefaultRequestHandler from a2a.server.tasks import InMemoryTaskStore - from a2a.types import AgentCard + from a2a.types import AgentCard, JSONRPCRequest from a2a.utils.constants import AGENT_CARD_WELL_KNOWN_PATH + from starlette.responses import Response from ..a2a.executor.a2a_agent_executor import A2aAgentExecutor @@ -375,7 +376,7 @@ async def _get_a2a_runner_async() -> Runner: ) for new_route in routes: - app.router.routes.append(new_route) + app.add_api_route(new_route.path, new_route.endpoint, name=new_route.name, methods=new_route.methods, tags=["A2A Endpoints"]) logger.info("Successfully configured A2A agent: %s", app_name) From 66d085b00d0446bb1eaecaafb4e0569b58221411 Mon Sep 17 00:00:00 2001 From: Dylan Snyder <114695692+dylan-apex@users.noreply.github.com> Date: Wed, 20 Aug 2025 18:53:45 -0500 Subject: [PATCH 2/3] autoformat --- src/google/adk/cli/fast_api.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/google/adk/cli/fast_api.py b/src/google/adk/cli/fast_api.py index 7ec2a2577b..6182c6c488 100644 --- a/src/google/adk/cli/fast_api.py +++ b/src/google/adk/cli/fast_api.py @@ -309,7 +309,7 @@ async def get_agent_builder(app_name: str, file_path: Optional[str] = None): from a2a.server.apps import A2AStarletteApplication from a2a.server.request_handlers import DefaultRequestHandler from a2a.server.tasks import InMemoryTaskStore - from a2a.types import AgentCard, JSONRPCRequest + from a2a.types import AgentCard from a2a.utils.constants import AGENT_CARD_WELL_KNOWN_PATH from starlette.responses import Response @@ -376,7 +376,13 @@ async def _get_a2a_runner_async() -> Runner: ) for new_route in routes: - app.add_api_route(new_route.path, new_route.endpoint, name=new_route.name, methods=new_route.methods, tags=["A2A Endpoints"]) + app.add_api_route( + new_route.path, + new_route.endpoint, + name=new_route.name, + methods=new_route.methods, + tags=["A2A Endpoints"], + ) logger.info("Successfully configured A2A agent: %s", app_name) From bff6252492a231c520e28245c1db30ad3f92fcbf Mon Sep 17 00:00:00 2001 From: Dylan Snyder <114695692+dylan-apex@users.noreply.github.com> Date: Wed, 20 Aug 2025 19:28:22 -0500 Subject: [PATCH 3/3] forgotten import while testing --- src/google/adk/cli/fast_api.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/google/adk/cli/fast_api.py b/src/google/adk/cli/fast_api.py index 6182c6c488..ab103edacf 100644 --- a/src/google/adk/cli/fast_api.py +++ b/src/google/adk/cli/fast_api.py @@ -311,7 +311,6 @@ async def get_agent_builder(app_name: str, file_path: Optional[str] = None): from a2a.server.tasks import InMemoryTaskStore from a2a.types import AgentCard from a2a.utils.constants import AGENT_CARD_WELL_KNOWN_PATH - from starlette.responses import Response from ..a2a.executor.a2a_agent_executor import A2aAgentExecutor