def METHOD_NAME(self, retriever_mode: TreeRetrieverMode) -> None:
    """Check if index supports modes that require trees."""
    if retriever_mode in REQUIRE_TREE_MODES and not self.build_tree:
        raise ValueError(
            "Index was constructed without building trees, "
            f"but retriever mode {retriever_mode} requires trees."
        )