Skip to main content
Sometimes you want to reach an environment over a standard wire protocol instead of the SDK. This example puts one in front of Chat: it serves a messages-style task as an A2A endpoint, so any A2A client - including another LLM using it as a tool - can hold a conversation with your environment. A Chat is HUD’s multi-turn conversation object, and it is protocol-agnostic (see Chat). The A2A layer is a reference server kept outside the SDK on purpose, so you copy and adapt it from cookbooks/a2a-chat.

The pieces

The environment

A chat-style task takes the running conversation as a messages parameter and yields it as the prompt:
chat_env.py

Run it

From cookbooks/a2a-chat (uv resolves the dependencies on first run):
The server publishes an agent card at /.well-known/agent-card.json and accepts A2A messages at the root endpoint. Each A2A context gets its own Chat, so concurrent conversations stay independent. You configure the server through environment variables:

See also

Chat

Integrations