Example: Basic Usage
Import the trajectory extension
Import
TrajectoryExtensionServer and TrajectoryExtensionSpec from agentstack_sdk.a2a.extensions.Inject the extension
Add a trajectory parameter to your agent function using the
Annotated type hint
with TrajectoryExtensionSpec().Markdown Support
Thecontent field of trajectory_metadata supports Markdown, which is rendered directly in the UI.
Supported elements include:
- Headers
- Bold and italic text
- Ordered and unordered lists
- Tables
- Code blocks
- Links
- Checklists
Grouping Trajectories
Use thegroup_id parameter to update trajectory content in the UI. Each update replaces the previous content (and title, if defined) for the same group_id: