Skip to main content
Stream events let you react to agent activity - update UI, log activity, or integrate with other systems.

Quick Start

1

Create Stream Events

2

Handle Events

3

Track Metrics


StreamEventType

Events emitted during streaming.

StreamEvent

Structure for streaming events.

Factory Methods

Builder Methods


Best Practices

Process events quickly - avoid blocking the stream.
Great for logging, metrics, progress updates, and debugging.
Use FirstToken event to measure Time To First Token.

Hooks

Intercept and modify behavior

Streaming

Enable response streaming