# split_list_of_docs

> **Function** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/chains/combine_documents/reduce/split_list_of_docs)

Split `Document` objects to subsets that each meet a cumulative len. constraint.

## Signature

```python
split_list_of_docs(
    docs: list[Document],
    length_func: Callable,
    token_max: int,
    **kwargs: Any = {},
) -> list[list[Document]]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `docs` | `list[Document]` | Yes | The full list of `Document` objects. |
| `length_func` | `Callable` | Yes | Function for computing the cumulative length of a set of `Document` objects. |
| `token_max` | `int` | Yes | The maximum cumulative length of any subset of `Document` objects. |
| `**kwargs` | `Any` | No | Arbitrary additional keyword params to pass to each call of the `length_func`. (default: `{}`) |

## Returns

`list[list[Document]]`

A `list[list[Document]]`.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/f0c5a28fa05adcda89aebcb449d897245ab21fa4/libs/langchain/langchain_classic/chains/combine_documents/reduce.py#L30)