langchain.chains.combine_documents.reduce
.split_list_of_docsΒΆ
- langchain.chains.combine_documents.reduce.split_list_of_docs(docs: List[Document], length_func: Callable, token_max: int, **kwargs: Any) List[List[Document]] [source]ΒΆ
Split Documents into subsets that each meet a cumulative length constraint.
- Parameters
docs β The full list of Documents.
length_func β Function for computing the cumulative length of a set of Documents.
token_max β The maximum cumulative length of any subset of Documents.
**kwargs β Arbitrary additional keyword params to pass to each call of the length_func.
- Returns
A List[List[Document]].