Split Document objects to subsets that each meet a cumulative len. constraint.
split_list_of_docs(
docs: list[Document],
length_func: Callable,
token_max: int,
**kwargs: Any = {}
) -> list[list[Document]]| Name | Type | Description |
|---|---|---|
docs* | list[Document] | The full list of |
length_func* | Callable | Function for computing the cumulative length of a set of |
token_max* | int | The maximum cumulative length of any subset of |
**kwargs | Any | Default: {}Arbitrary additional keyword params to pass to each call of the
|