> ## 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.

# ストリーミング

> PHPエージェントのテキスト、推論、項目、ライフサイクルの各ストリームを利用します。

`Agent::stream(...)`は`AgentStreamResult`を返します。

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

foreach ($stream->textStream() as $delta) {
    echo $delta;
}

$completed = $stream->result;
```

別の形式で取得するには`reasoningStream()`、`itemStream()`、または`fullStream()`を使います。プロバイダーの同期ストリームからイベントを読み取った後も、各イテラブルを再走査できます。

PHPの項目値は引き続き汎用の配列やオブジェクトであり、TypeScriptの判別可能な項目ユニオンではありません。

## 関連項目

* [ツール](./agent-sdk-tools.mdx)
* [オブザーバビリティとDevTools](./agent-sdk-observability.mdx)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.