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

# ストリーミング

> 再生可能なコンシューマーでGoエージェントのテキストとイベントをストリーミングします。

`Agent.Stream(...)`は再生可能な`StreamResult`を返します。

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

for delta := range stream.Text() {
  fmt.Print(delta)
}

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

ライフサイクルイベントやプロバイダーイベントには`Events()`を使います。ストリームコンテキストと実行中のモデルリクエストをキャンセルするには`Cancel()`を呼び出します。

Goには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.