Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e191ea9
Enhance agent_to_a2a with optional services
secprog Oct 21, 2025
6dd83a7
Update src/google/adk/a2a/utils/agent_to_a2a.py
secprog Oct 21, 2025
1e4dd51
Update src/google/adk/a2a/utils/agent_to_a2a.py
secprog Oct 21, 2025
82ef1c6
Update src/google/adk/a2a/utils/agent_to_a2a.py
secprog Oct 21, 2025
8cd5891
Merge branch 'google:main' into main
secprog Oct 21, 2025
17f6dfd
Merge branch 'main' into main
secprog Oct 21, 2025
0795aaa
Merge branch 'google:main' into main
secprog Oct 21, 2025
88b50ea
Merge branch 'google:main' into main
secprog Oct 22, 2025
1a51c89
test: add tests for Enhance agent_to_a2a with optional services
secprog Oct 22, 2025
a6d6c0f
Merge branch 'main' into main
secprog Oct 22, 2025
e393c04
Update src/google/adk/a2a/utils/agent_to_a2a.py
secprog Oct 22, 2025
5dfba4a
Update src/google/adk/a2a/utils/agent_to_a2a.py
secprog Oct 22, 2025
8daf193
Update src/google/adk/a2a/utils/agent_to_a2a.py
secprog Oct 22, 2025
f6134c5
test: Enhance unit tests for A2A with new mock fixture and service pa…
secprog Oct 22, 2025
f1aae7a
Merge branch 'main' of https://github.com/secprog/adk-python
secprog Oct 22, 2025
c1fe059
Merge branch 'main' into main
secprog Oct 22, 2025
d6a280e
Update src/google/adk/a2a/utils/agent_to_a2a.py
secprog Oct 22, 2025
eae242b
refactor: Improve docstring formatting for session_service parameter …
secprog Oct 22, 2025
5fcafa9
refactor: Simplify unit tests for A2A by utilizing mock fixture
secprog Oct 22, 2025
61593aa
Update src/google/adk/a2a/utils/agent_to_a2a.py
secprog Oct 22, 2025
3a5ca70
Update src/google/adk/a2a/utils/agent_to_a2a.py
secprog Oct 22, 2025
7710735
Merge branch 'main' into main
hangfei Oct 23, 2025
bbd7330
Merge branch 'main' into main
secprog Oct 25, 2025
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
26 changes: 20 additions & 6 deletions src/google/adk/a2a/utils/agent_to_a2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
from starlette.applications import Starlette

from ...agents.base_agent import BaseAgent
from ...artifacts.base_artifact_service import BaseArtifactService
from ...auth.credential_service.base_credential_service import BaseCredentialService
from ...memory.base_memory_service import BaseMemoryService
from ...sessions.base_session_service import BaseSessionService
from ...artifacts.in_memory_artifact_service import InMemoryArtifactService
from ...auth.credential_service.in_memory_credential_service import InMemoryCredentialService
from ...cli.utils.logs import setup_adk_logger
Expand Down Expand Up @@ -90,6 +94,10 @@ def to_a2a(
port: int = 8000,
protocol: str = "http",
agent_card: Optional[Union[AgentCard, str]] = None,
artifact_service: Optional[BaseArtifactService] = InMemoryArtifactService(),
credential_service: Optional[BaseCredentialService] = InMemoryCredentialService(),
memory_service: Optional[BaseMemoryService] = InMemoryMemoryService(),
session_service: Optional[BaseSessionService] = InMemorySessionService(),
) -> Starlette:
"""Convert an ADK agent to a A2A Starlette application.

Expand All @@ -101,7 +109,14 @@ def to_a2a(
agent_card: Optional pre-built AgentCard object or path to agent card
JSON. If not provided, will be built automatically from the
agent.

artifact_service: Service for artifact management (file storage, logs, etc.).
Defaults to in-memory artifact service.
credential_service: Service for authentication/credential management.
Defaults to in-memory credential service.
memory_service: Service for conversation or workspace memory.
Defaults to in-memory memory service.
session_service: Service for session management. Defaults to in-memory service.

Returns:
A Starlette application that can be run with uvicorn

Expand All @@ -121,11 +136,10 @@ async def create_runner() -> Runner:
return Runner(
app_name=agent.name or "adk_agent",
agent=agent,
# Use minimal services - in a real implementation these could be configured
artifact_service=InMemoryArtifactService(),
session_service=InMemorySessionService(),
memory_service=InMemoryMemoryService(),
credential_service=InMemoryCredentialService(),
artifact_service=artifact_service,
session_service=session_service,
memory_service=memory_service,
credential_service=credential_service,
)

# Create A2A components
Expand Down
Loading