A2AConfig
autogen.beta.a2a.config.A2AConfig dataclass #
A2AConfig(card_url, prefer=None, streaming=True, headers=None, timeout=60.0, max_reconnects=3, reconnect_backoff=0.5, polling_interval=0.5, input_required_timeout=None, httpx_client_factory=None, interceptors=(), grpc_channel_factory=None, preset_card=None, tenant=None, history_length=None)
Bases: ModelConfig
Connection config for an A2A agent acting as an LLM provider.
card_url is the HTTP(S) URL where the agent card is published (fetched from {card_url}/.well-known/agent-card.json per spec). The actual transport endpoint for the request/response exchange is read from card.supported_interfaces — the user does not pass it.
prefer selects a transport when the server card declares more than one binding. None (default) auto-picks: if exactly one interface matches card_url it is used; otherwise the first server-listed interface wins. Pass "jsonrpc" | "rest" | "grpc" to force a specific binding.
polling_interval is used when the server card declares capabilities.streaming=False or when the user opts into streaming=False: Task state is polled via get_task every polling_interval seconds until terminal.
input_required_timeout caps how long the client waits on the HITL hook when the server transitions a task into TASK_STATE_INPUT_REQUIRED. None means wait indefinitely (matches ConversationContext.input).
grpc_channel_factory builds a grpc.aio.Channel for a given URL when the resolved transport is gRPC. Optional — defaults to insecure_channel via default_grpc_channel_factory.
tenant scopes every outgoing request to a specific tenant on the remote server (A2A multi-tenancy: a single shared backend can isolate data per tenant). Per-call override is available via context.variables["a2a:tenant"].
history_length truncates the server-side Task.history echoed back on get_task / list operations to the most recent N messages. Pure server-side hint — does not change what the client uploads.
httpx_client_factory class-attribute instance-attribute #
httpx_client_factory = field(default=None, repr=False)
grpc_channel_factory class-attribute instance-attribute #
grpc_channel_factory = field(default=None, repr=False)
copy #
from_card classmethod #
Construct a config from a pre-fetched AgentCard.
Useful when the card has already been resolved (e.g. via a discovery service) and a network round-trip on connect can be skipped. card_url defaults to the first interface declared on the card; raises A2AInvalidCardError if neither is available.