mirror of https://github.com/hwchase17/langchain
langchain[patch]: Update docstore module to use optional imports from community (#21091)
parent
d640605694
commit
86ff8a3fb4
@ -1,3 +1,23 @@
|
||||
from langchain_community.docstore.arbitrary_fn import DocstoreFn
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["DocstoreFn"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.docstore.arbitrary_fn import DocstoreFn
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"DocstoreFn": "langchain_community.docstore.arbitrary_fn"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DocstoreFn",
|
||||
]
|
||||
|
@ -1,3 +1,27 @@
|
||||
from langchain_community.docstore.base import AddableMixin, Docstore
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["Docstore", "AddableMixin"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.docstore.base import AddableMixin, Docstore
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"Docstore": "langchain_community.docstore.base",
|
||||
"AddableMixin": "langchain_community.docstore.base",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"Docstore",
|
||||
"AddableMixin",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.docstore.in_memory import InMemoryDocstore
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["InMemoryDocstore"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.docstore.in_memory import InMemoryDocstore
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"InMemoryDocstore": "langchain_community.docstore.in_memory"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"InMemoryDocstore",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.docstore.wikipedia import Wikipedia
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["Wikipedia"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.docstore.wikipedia import Wikipedia
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"Wikipedia": "langchain_community.docstore.wikipedia"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"Wikipedia",
|
||||
]
|
||||
|
Loading…
Reference in New Issue