# StreamAlreadyConsumed

> **Class** in `langsmith`

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

Attempted to read or stream content, but the content has already
been streamed.

This can happen if you use a method like `.iter_lines()` and then attempt
to read th entire response body afterwards, e.g.

```py
response = await client.post(...)
async for line in response.iter_lines():
    ...  # do something with `line`

content = await response.read()
# ^ error
```

If you want this behaviour you'll need to either manually accumulate the response
content or call `await response.read()` before iterating over the stream.

## Signature

```python
StreamAlreadyConsumed(
    self,
)
```

## Extends

- `LangsmithError`

## Constructors

```python
__init__(
    self,
) -> None
```


---

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