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

# 結果と項目の扱い

> メッセージ、ステップ、ツール、ストリーミング項目からPythonの実行タイムラインを構築します。

`AgentRunResult`には、永続的な実行状態、メッセージ、ステップ、使用量とコスト、警告、終了理由、最終出力が含まれます。

回答テキストには`text_stream()`、プロバイダーやランタイムの項目には`item_stream()`を使います。Pythonの項目は現在辞書形式であり、TypeScriptの判別可能なユニオン型`AgentItem`ではありません。

```python theme={null}
for item in stream.item_stream():
    item_type = item.get("type")
    render_timeline_item(item_type, item)
```

プロバイダー固有の辞書へのアクセスはアプリケーションアダプター1つにまとめ、完了した結果を保存して後で再構築できるようにします。

## 関連項目

* [ストリーミング](./agent-sdk-streaming.mdx)
* [ライフサイクルフック](./agent-sdk-lifecycle-hooks.mdx)


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