# Stream

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/_openapi_client/_streaming/Stream)

Provides the core interface to iterate over a synchronous stream response.

## Signature

```python
Stream(
    self,
    *,
    cast_to: type[_T],
    response: httpx.Response,
    client: Langsmith,
    options: Optional[FinalRequestOptions] = None,
)
```

## Extends

- `Generic[_T]`

## Constructors

```python
__init__(
    self,
    *,
    cast_to: type[_T],
    response: httpx.Response,
    client: Langsmith,
    options: Optional[FinalRequestOptions] = None,
) -> None
```

| Name | Type |
|------|------|
| `cast_to` | `type[_T]` |
| `response` | `httpx.Response` |
| `client` | `Langsmith` |
| `options` | `Optional[FinalRequestOptions]` |


## Properties

- `response`

## Methods

- [`close()`](https://reference.langchain.com/python/langsmith/_openapi_client/_streaming/Stream/close)

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/d6cd6082f09e7826a2d6afe444ae6119e61b82a6/python/langsmith/_openapi_client/_streaming.py#L22)