> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream items

> Consume text, reasoning, tool, and provider item events from Go agent runs.

`Stream` exposes a replayable event sequence for live agent interfaces. Text deltas are the simplest consumer; the full event stream also carries reasoning, provider items, tool progress, lifecycle changes, and the final response.

```go theme={null}
stream := agent.Stream(ctx, phaseoagent.RunOptions{Input: prompt, Client: client})

for event := range stream.Events() {
  switch event.Type {
  case "response.output_text.delta":
    fmt.Print(event.Details["delta"])
  case "response.reasoning.delta":
    renderReasoning(event.Details)
  case "response.item":
    renderItem(event.Details["item"])
  case "tool.preliminary_result":
    renderProgress(event.Details)
  }
}

result, err := stream.Result()
```

<Note>
  Go currently exposes provider items through the generic `AgentEvent` details map rather than a closed typed item union. Switch on `event.Type`, validate item payloads at your UI boundary, and keep an unknown-event fallback for forward compatibility.
</Note>

The event history is replayable after completion, so separate consumers can render text, persist events, and build an audit timeline without starting another model request.
