From 422b35cdb784c3b60d06ad605317ab84c7d53235 Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Wed, 14 Jan 2026 05:11:24 -0500 Subject: [PATCH] feat: add additional a2a fields, deprecate old config --- lib/crewai/src/crewai/a2a/config.py | 22 +++++++++++++++---- lib/crewai/src/crewai/a2a/utils/agent_card.py | 3 ++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/crewai/src/crewai/a2a/config.py b/lib/crewai/src/crewai/a2a/config.py index b0ac83405..2b1366e81 100644 --- a/lib/crewai/src/crewai/a2a/config.py +++ b/lib/crewai/src/crewai/a2a/config.py @@ -10,6 +10,7 @@ from typing import Any, ClassVar from a2a.types import ( AgentCapabilities, + AgentCardSignature, AgentInterface, AgentProvider, AgentSkill, @@ -34,7 +35,10 @@ def _get_default_update_config() -> UpdateConfig: return StreamingConfig() -@deprecated("Use A2AClientConfig instead.") +@deprecated( + "Use `crewai.a2a.config.A2AClientConfig` or `crewai.a2a.config.A2AServerConfig` instead.", + category=FutureWarning, +) class A2AConfig(BaseModel): """Configuration for A2A protocol integration. @@ -167,6 +171,8 @@ class A2AServerConfig(BaseModel): security: Security requirement objects for all interactions. security_schemes: Security schemes available to authorize requests. supports_authenticated_extended_card: Whether agent provides extended card to authenticated users. + url: Preferred endpoint URL for the agent. + signatures: JSON Web Signatures for the AgentCard. """ model_config: ClassVar[ConfigDict] = ConfigDict(extra="forbid") @@ -198,7 +204,7 @@ class A2AServerConfig(BaseModel): capabilities: AgentCapabilities = Field( default_factory=lambda: AgentCapabilities( streaming=True, - push_notifications=True, + push_notifications=False, ), description="Declaration of optional capabilities supported by the agent", ) @@ -214,11 +220,11 @@ class A2AServerConfig(BaseModel): default=None, description="Information about the agent's service provider", ) - documentation_url: str | None = Field( + documentation_url: Url | None = Field( default=None, description="URL to the agent's documentation", ) - icon_url: str | None = Field( + icon_url: Url | None = Field( default=None, description="URL to an icon for the agent", ) @@ -238,3 +244,11 @@ class A2AServerConfig(BaseModel): default=False, description="Whether agent provides extended card to authenticated users", ) + url: Url | None = Field( + default=None, + description="Preferred endpoint URL for the agent. Set at runtime if not provided.", + ) + signatures: list[AgentCardSignature] = Field( + default_factory=list, + description="JSON Web Signatures for the AgentCard", + ) diff --git a/lib/crewai/src/crewai/a2a/utils/agent_card.py b/lib/crewai/src/crewai/a2a/utils/agent_card.py index bd8c4db65..513274ede 100644 --- a/lib/crewai/src/crewai/a2a/utils/agent_card.py +++ b/lib/crewai/src/crewai/a2a/utils/agent_card.py @@ -361,7 +361,7 @@ def _agent_to_agent_card(agent: Agent, url: str) -> AgentCard: return AgentCard( name=name, description=description, - url=url, + url=server_config.url or url, version=server_config.version, capabilities=server_config.capabilities, default_input_modes=server_config.default_input_modes, @@ -375,6 +375,7 @@ def _agent_to_agent_card(agent: Agent, url: str) -> AgentCard: security=server_config.security, security_schemes=server_config.security_schemes, supports_authenticated_extended_card=server_config.supports_authenticated_extended_card, + signatures=server_config.signatures, )