def build_from_nodes(
        self,
        nodes: Sequence[BaseNode],
        build_tree: bool = True,
    ) -> IndexGraph:
        """
        Build from text.

        Returns:
            IndexGraph: graph object consisting of all_nodes, root_nodes

        """
        index_graph = IndexGraph()
        for node in nodes:
            index_graph.insert(node)

        if build_tree:
            return self.build_index_from_nodes(
                index_graph, index_graph.all_nodes, index_graph.all_nodes, level=0
            )
        else:
            return index_graph

        Build from text.

        Returns:
            IndexGraph: graph object consisting of all_nodes, root_nodes

        
llama-index-core/llama_index/core/indices/common_tree/base.py