> ## 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 PHP agent runs.

The stream result exposes replayable consumers for text and structured events.

```php theme={null}
$stream = $agent->stream(input: $prompt, client: $client);

foreach ($stream->itemStream() as $item) {
    renderItem($item);
}

$result = $stream->getResult();
```

Use the full event stream when the UI needs reasoning deltas, tool progress, approval checkpoints, or lifecycle changes in addition to provider items.

<Note>
  PHP item values are generic arrays or objects rather than a closed typed item union. Validate the fields your UI consumes and preserve an unknown-item fallback for newer provider events.
</Note>

PHP consumes the provider stream synchronously and makes the collected sequence replayable. This is appropriate for request workers and CLI programs, but it is not a background push channel by itself.
