Skip to main content
Use items to build a structured agent timeline without parsing provider-specific events. Streaming and completed runs expose the same ordered AgentItem<TOutput> contract.

Item types

AgentItem<TOutput> is a discriminated union:

Render a streamed timeline

TypeScript narrows each item from its type:

Read items after completion

The completed result contains the same ordered item shapes:
This lets a product render live activity and later rebuild the same timeline from persisted run state.

Access provider-specific data

Provider output is normalized into portable item types. When an integration still needs a provider-specific field, normalized provider items retain the original payload in rawProviderItem. Keep product logic on the portable fields where possible. Treat rawProviderItem as an escape hatch for provider-specific integrations, not as the default application contract.
Last modified on July 26, 2026