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

# autogen.io.IOStream

<h2 id="autogen.io.IOStream" class="doc doc-heading">
  <code class="doc-symbol doc-symbol-heading doc-symbol-class" />

  <span class="doc doc-object-name doc-class-name">IOStream</span>
</h2>

```python theme={null}
IOStream()
```

A protocol for input/output streams.

### Static Methods

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### get\_default

```python theme={null}
get_default() -> IOStreamProtocol | AsyncIOStreamProtocol
```

Get the default input/output stream.<br />Returns: <br />    IOStream: The default input/output stream.

<b>Returns:</b>

| Type                                                                                                                                                 | Description                                |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| [IOStreamProtocol](/docs/api-reference/autogen/io/IOStreamProtocol) \| [AsyncIOStreamProtocol](/docs/api-reference/autogen/io/AsyncIOStreamProtocol) | IOStream: The default input/output stream. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### get\_global\_default

```python theme={null}
get_global_default() -> IOStreamProtocol | AsyncIOStreamProtocol
```

Get the default input/output stream.<br />Returns: <br />    IOStream: The default input/output stream.

<b>Returns:</b>

| Type                                                                                                                                                 | Description                                |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| [IOStreamProtocol](/docs/api-reference/autogen/io/IOStreamProtocol) \| [AsyncIOStreamProtocol](/docs/api-reference/autogen/io/AsyncIOStreamProtocol) | IOStream: The default input/output stream. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### set\_default

```python theme={null}
set_default(stream: IOStreamProtocol | AsyncIOStreamProtocol | None) -> Iterator[None]
```

Set the default input/output stream.<br />

<b>Parameters:</b>

| Name     | Description                                                                                                                                                                                                                      |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `stream` | The input/output stream to set as the default.<br /><br />**Type:** [IOStreamProtocol](/docs/api-reference/autogen/io/IOStreamProtocol) \| [AsyncIOStreamProtocol](/docs/api-reference/autogen/io/AsyncIOStreamProtocol) \| None |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### set\_global\_default

```python theme={null}
set_global_default(stream: IOStreamProtocol | AsyncIOStreamProtocol) -> None
```

Set the default input/output stream.<br />

<b>Parameters:</b>

| Name     | Description                                                                                                                                                                                                              |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `stream` | The input/output stream to set as the default.<br /><br />**Type:** [IOStreamProtocol](/docs/api-reference/autogen/io/IOStreamProtocol) \| [AsyncIOStreamProtocol](/docs/api-reference/autogen/io/AsyncIOStreamProtocol) |

<br />
