async def abuild_index_from_nodes(
        self,
        index_graph: IndexGraph,
        cur_node_ids: Dict[int, str],
        all_node_ids: Dict[int, str],
        level: int = 0,
    ) -> IndexGraph:
        """Consolidates chunks recursively, in a bottoms-up fashion."""
        if len(cur_node_ids) <= self.num_children:
            index_graph.root_nodes = cur_node_ids
            return index_graph

        indices, cur_nodes_chunks, text_chunks = self._prepare_node_and_text_chunks(
            cur_node_ids
        )

        with self._callback_manager.event(
            CBEventType.TREE, payload={EventPayload.CHUNKS: text_chunks}
        ) as event:
            text_chunks_progress = get_tqdm_iterable(
                text_chunks,
                show_progress=self._show_progress,
                desc="Generating summaries",
            )
            tasks = [
                self._llm.apredict(self.summary_prompt, context_str=text_chunk)
                for text_chunk in text_chunks_progress
            ]
            summaries = await asyncio.gather(*tasks)

            event.on_end(payload={"summaries": summaries, "level": level})

        new_node_dict = self._construct_parent_nodes(
            index_graph, indices, cur_nodes_chunks, summaries
        )
        all_node_ids.update(new_node_dict)

        index_graph.root_nodes = new_node_dict

        if len(new_node_dict) <= self.num_children:
            return index_graph
        else:
            return await self.abuild_index_from_nodes(
                index_graph, new_node_dict, all_node_ids, level=level + 1
            )
Consolidates chunks recursively, in a bottoms-up fashion.
llama-index-core/llama_index/core/indices/common_tree/base.py