The AgentCard structure has been redesigned in v1.0 to support multiple transport bindings and improved capability definitions.
Major Changes:
- Transport Bindings: The
url parameter is removed from AgentCard. Instead, use the supported_interfaces field, which contains a list of AgentInterface objects. Each AgentInterface defines a protocol_binding ('JSONRPC', 'HTTP+JSON', or 'GRPC') and its own url. - Capabilities:
AgentCapabilities.supports_authenticated_extended_card is renamed to AgentCapabilities.extended_agent_card. The input_modes and output_modes fields were removed from AgentCapabilities; use AgentCard.default_input_modes and AgentCard.default_output_modes for card-level defaults. - Skill Examples: The
examples parameter was removed from AgentCard and moved to AgentSkill.
from a2a.types import AgentCard, AgentCapabilities, AgentInterface, AgentSkill
skill = AgentSkill(
id='hello_world',
name='Hello World',
description='Returns a Hello World message.',
tags=['hello', 'world'],
input_modes=['text/plain'],
output_modes=['text/plain'],
examples=['hello world', 'Hello, World!'], # moved from AgentCard.examples
)
agent_card = AgentCard(
name='Hello World Agent',
supported_interfaces=[
# JSON-RPC
AgentInterface(
protocol_binding='JSONRPC',
url='http://localhost:41241/a2a/jsonrpc/',
),
# GRPC
AgentInterface(
protocol_binding='GRPC',
url='http://localhost:50051/a2a/grpc/',
)
],
version='0.0.1',
default_input_modes=['text/plain'],
default_output_modes=['text/plain'],
capabilities=AgentCapabilities(
streaming=True,
extended_agent_card=True,
),
skills=[skill],
)