def METHOD_NAME(
    self,
    docs: List[dict],
    token_max: Optional[int] = None,
    **kwargs: Any,
) -> Tuple[List[dict], dict]:
    length_func = self.combine_documents.prompt_length
    num_tokens = length_func(docs, **kwargs)
    def _collapse_docs_func(docs: List[dict], **kwargs: Any) -> str:
        return self._collapse_node.run(documents=docs, **kwargs)
    _token_max = token_max or self.token_max
    while num_tokens is not None and num_tokens > _token_max:
        new_result_doc_list = _split_list_of_docs(docs, length_func, _token_max, **kwargs)
        docs = []
        for docs_item in new_result_doc_list:
            new_doc = _collapse_docs(docs_item, _collapse_docs_func, **kwargs)
            docs.append(new_doc)
        num_tokens = length_func(docs, **kwargs)
    return docs, {}