# extract_stream_chunk_type

> **Function** in `langsmith`

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

Given a type like `Stream[T]`, returns the generic type variable `T`.

This also handles the case where a concrete subclass is given, e.g.
```py
class MyStream(Stream[bytes]):
    ...

extract_stream_chunk_type(MyStream) -> bytes
```

## Signature

```python
extract_stream_chunk_type(
    stream_cls: type,
    *,
    failure_message: str | None = None,
) -> type
```

---

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