Understand how the main communication unit works when building your own agent
yield
with AgentMessage
to send textual data to the agent consumer. This concept has two important parts:
AgentMessage
is a convenience wrapper around A2A Message
that simplifies common use cases. Think of responding with text to the client.Message
that makes it easy to create responses:
Message
objects:
Message
containing DataPart
AgentMessage
but simplifies work with Artifacts.
TextPart
contains text data. A Message
consists of multiple Part
objects. Can be any of TextPart
, FilePart
, or DataPart
.