# StreamAlreadyConsumed

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/_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-python/blob/e9d3961c7165d87b6312f379f3a4a477aebb1f97/src/langsmith/_response.py#L566)