In Agent Stack, you communicate with the client by yielding data. This concept consists of two parts:Documentation Index
Fetch the complete documentation index at: https://agentstack.beeai.dev/llms.txt
Use this file to discover all available pages before exploring further.
- Yielding data: Sending data from your agent implementation to the client.
- The Wrapper: Using convenience objects like
AgentMessageto simplify the underlying A2A Protocol requirements.
Choosing Your Message Type
| Type | Best For… | Key Benefit |
|---|---|---|
Simple Data (str, dict) | Simple text or JSON | Automatic conversion |
| AgentMessage | Standard conversational responses | Auto-generates IDs and handles TextPart wrapping |
| AgentArtifact | Returning files, documents, or assets | Automatically wraps content into A2A Part objects |
| A2A Components | Advanced protocol-level control | Full control over Role, UUID, and Part lists |
| TaskStatus | Tracking stateful progress | Allows you to signal specific states like input_required |
Simplified Yielding
The Agent Stack SDK allows you to yield simple Python types. These are automatically converted into textual A2AMessage objects for ease of use.
Plain Strings
Plain Dictionaries
Convenience Wrappers
Wrappers provide a balance between ease of use and metadata support.AgentMessage
The most common way to respond with text. It simplifies creating A2AMessage objects and supports metadata.
AgentArtifact
Similar toAgentMessage, but specifically designed to simplify the creation and handling of Artifacts (tangible outputs).
Direct A2A Components
For advanced use cases, you can yield direct A2A protocol components.Message
The basic unit representing a single turn in a conversation.Part
The fundamental unit of content. AMessage consists of multiple Part objects such as TextPart, FilePart, or DataPart.