codekingpro/portable-devtools
114k
1"""**Graphs** provide a natural language interface to graph databases."""2 3from typing import TYPE_CHECKING, Any4 5from langchain_classic._api import create_importer6 7if TYPE_CHECKING:8 from langchain_community.graphs.index_creator import GraphIndexCreator9 from langchain_community.graphs.networkx_graph import NetworkxEntityGraph10 11 12# Create a way to dynamically look up deprecated imports.13# Used to consolidate logic for raising deprecation warnings and14# handling optional imports.15DEPRECATED_LOOKUP = {16 "GraphIndexCreator": "langchain_community.graphs.index_creator",17 "NetworkxEntityGraph": "langchain_community.graphs.networkx_graph",18}19 20_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)21 22 23def __getattr__(name: str) -> Any:24 """Look up attributes dynamically."""25 return _import_attribute(name)26 27 28__all__ = ["GraphIndexCreator", "NetworkxEntityGraph"]29 