mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-02 07:42:40 +00:00
feat: add additional a2a fields, deprecate old config
This commit is contained in:
@@ -10,6 +10,7 @@ from typing import Any, ClassVar
|
|||||||
|
|
||||||
from a2a.types import (
|
from a2a.types import (
|
||||||
AgentCapabilities,
|
AgentCapabilities,
|
||||||
|
AgentCardSignature,
|
||||||
AgentInterface,
|
AgentInterface,
|
||||||
AgentProvider,
|
AgentProvider,
|
||||||
AgentSkill,
|
AgentSkill,
|
||||||
@@ -34,7 +35,10 @@ def _get_default_update_config() -> UpdateConfig:
|
|||||||
return StreamingConfig()
|
return StreamingConfig()
|
||||||
|
|
||||||
|
|
||||||
@deprecated("Use A2AClientConfig instead.")
|
@deprecated(
|
||||||
|
"Use `crewai.a2a.config.A2AClientConfig` or `crewai.a2a.config.A2AServerConfig` instead.",
|
||||||
|
category=FutureWarning,
|
||||||
|
)
|
||||||
class A2AConfig(BaseModel):
|
class A2AConfig(BaseModel):
|
||||||
"""Configuration for A2A protocol integration.
|
"""Configuration for A2A protocol integration.
|
||||||
|
|
||||||
@@ -167,6 +171,8 @@ class A2AServerConfig(BaseModel):
|
|||||||
security: Security requirement objects for all interactions.
|
security: Security requirement objects for all interactions.
|
||||||
security_schemes: Security schemes available to authorize requests.
|
security_schemes: Security schemes available to authorize requests.
|
||||||
supports_authenticated_extended_card: Whether agent provides extended card to authenticated users.
|
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")
|
model_config: ClassVar[ConfigDict] = ConfigDict(extra="forbid")
|
||||||
@@ -198,7 +204,7 @@ class A2AServerConfig(BaseModel):
|
|||||||
capabilities: AgentCapabilities = Field(
|
capabilities: AgentCapabilities = Field(
|
||||||
default_factory=lambda: AgentCapabilities(
|
default_factory=lambda: AgentCapabilities(
|
||||||
streaming=True,
|
streaming=True,
|
||||||
push_notifications=True,
|
push_notifications=False,
|
||||||
),
|
),
|
||||||
description="Declaration of optional capabilities supported by the agent",
|
description="Declaration of optional capabilities supported by the agent",
|
||||||
)
|
)
|
||||||
@@ -214,11 +220,11 @@ class A2AServerConfig(BaseModel):
|
|||||||
default=None,
|
default=None,
|
||||||
description="Information about the agent's service provider",
|
description="Information about the agent's service provider",
|
||||||
)
|
)
|
||||||
documentation_url: str | None = Field(
|
documentation_url: Url | None = Field(
|
||||||
default=None,
|
default=None,
|
||||||
description="URL to the agent's documentation",
|
description="URL to the agent's documentation",
|
||||||
)
|
)
|
||||||
icon_url: str | None = Field(
|
icon_url: Url | None = Field(
|
||||||
default=None,
|
default=None,
|
||||||
description="URL to an icon for the agent",
|
description="URL to an icon for the agent",
|
||||||
)
|
)
|
||||||
@@ -238,3 +244,11 @@ class A2AServerConfig(BaseModel):
|
|||||||
default=False,
|
default=False,
|
||||||
description="Whether agent provides extended card to authenticated users",
|
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",
|
||||||
|
)
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ def _agent_to_agent_card(agent: Agent, url: str) -> AgentCard:
|
|||||||
return AgentCard(
|
return AgentCard(
|
||||||
name=name,
|
name=name,
|
||||||
description=description,
|
description=description,
|
||||||
url=url,
|
url=server_config.url or url,
|
||||||
version=server_config.version,
|
version=server_config.version,
|
||||||
capabilities=server_config.capabilities,
|
capabilities=server_config.capabilities,
|
||||||
default_input_modes=server_config.default_input_modes,
|
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=server_config.security,
|
||||||
security_schemes=server_config.security_schemes,
|
security_schemes=server_config.security_schemes,
|
||||||
supports_authenticated_extended_card=server_config.supports_authenticated_extended_card,
|
supports_authenticated_extended_card=server_config.supports_authenticated_extended_card,
|
||||||
|
signatures=server_config.signatures,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user