# generate_from_stream

> **Function** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/language_models/chat_models/generate_from_stream)

Generate from a stream.

## Signature

```python
generate_from_stream(
    stream: Iterator[ChatGenerationChunk],
) -> ChatResult
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `stream` | `Iterator[ChatGenerationChunk]` | Yes | Iterator of `ChatGenerationChunk`. |

## Returns

`ChatResult`

Chat result.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/c197a7b6f757860df429aefb8e8a40a60d75987f/libs/core/langchain_core/language_models/chat_models.py#L206)