# generate_size_based_batches

> **Function** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/utilities/pebblo/generate_size_based_batches)

Generate batches of documents based on page_content size.
Args:
    docs: List of documents to be batched.
    max_batch_size: Maximum size of each batch in bytes. Defaults to 100*1024(100KB)
Returns:
    List[List[Document]]: List of batches of documents

## Signature

```python
generate_size_based_batches(
    docs: List[Document],
    max_batch_size: int = 100 * 1024,
) -> List[List[Document]]
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/utilities/pebblo.py#L318)