Ask a question to get started
Enter to sendā¢Shift+Enter new line
split_list_of_docs( docs: list[Document], length_func: Callable, token_max: int,
docs
list[Document]
The full list of Document objects.
Document
length_func
Callable
Function for computing the cumulative length of a set of Document objects.
token_max
int
The maximum cumulative length of any subset of Document objects.
**kwargs
Any
{}
Split Document objects to subsets that each meet a cumulative len. constraint.
Arbitrary additional keyword params to pass to each call of the length_func.