mirror of https://github.com/hwchase17/langchain
langchain[patch]: Migrate document transformers (#21098)
Migrate document transformerspull/21131/head
parent
aec13a6123
commit
9b6d04a187
@ -1,5 +1,25 @@
|
||||
from langchain_community.document_transformers.beautiful_soup_transformer import (
|
||||
BeautifulSoupTransformer,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["BeautifulSoupTransformer"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.document_transformers import BeautifulSoupTransformer
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"BeautifulSoupTransformer": "langchain_community.document_transformers"
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"BeautifulSoupTransformer",
|
||||
]
|
||||
|
@ -1,5 +1,25 @@
|
||||
from langchain_community.document_transformers.doctran_text_extract import (
|
||||
DoctranPropertyExtractor,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["DoctranPropertyExtractor"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.document_transformers import DoctranPropertyExtractor
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"DoctranPropertyExtractor": "langchain_community.document_transformers"
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DoctranPropertyExtractor",
|
||||
]
|
||||
|
@ -1,5 +1,25 @@
|
||||
from langchain_community.document_transformers.doctran_text_qa import (
|
||||
DoctranQATransformer,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["DoctranQATransformer"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.document_transformers import DoctranQATransformer
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"DoctranQATransformer": "langchain_community.document_transformers"
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DoctranQATransformer",
|
||||
]
|
||||
|
@ -1,5 +1,25 @@
|
||||
from langchain_community.document_transformers.doctran_text_translate import (
|
||||
DoctranTextTranslator,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["DoctranTextTranslator"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.document_transformers import DoctranTextTranslator
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"DoctranTextTranslator": "langchain_community.document_transformers"
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DoctranTextTranslator",
|
||||
]
|
||||
|
@ -1,5 +1,25 @@
|
||||
from langchain_community.document_transformers.google_translate import (
|
||||
GoogleTranslateTransformer,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["GoogleTranslateTransformer"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.document_transformers import GoogleTranslateTransformer
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"GoogleTranslateTransformer": "langchain_community.document_transformers"
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"GoogleTranslateTransformer",
|
||||
]
|
||||
|
@ -1,3 +1,25 @@
|
||||
from langchain_community.document_transformers.html2text import Html2TextTransformer
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["Html2TextTransformer"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.document_transformers import Html2TextTransformer
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"Html2TextTransformer": "langchain_community.document_transformers"
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"Html2TextTransformer",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.document_transformers.long_context_reorder import (
|
||||
LongContextReorder,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["LongContextReorder"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.document_transformers import LongContextReorder
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"LongContextReorder": "langchain_community.document_transformers"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"LongContextReorder",
|
||||
]
|
||||
|
@ -1,5 +1,25 @@
|
||||
from langchain_community.document_transformers.nuclia_text_transform import (
|
||||
NucliaTextTransformer,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["NucliaTextTransformer"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.document_transformers import NucliaTextTransformer
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"NucliaTextTransformer": "langchain_community.document_transformers"
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"NucliaTextTransformer",
|
||||
]
|
||||
|
@ -1,6 +1,32 @@
|
||||
from langchain_community.document_transformers.openai_functions import (
|
||||
OpenAIMetadataTagger,
|
||||
create_metadata_tagger,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["OpenAIMetadataTagger", "create_metadata_tagger"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.document_transformers import OpenAIMetadataTagger
|
||||
from langchain_community.document_transformers.openai_functions import (
|
||||
create_metadata_tagger,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"OpenAIMetadataTagger": "langchain_community.document_transformers",
|
||||
"create_metadata_tagger": (
|
||||
"langchain_community.document_transformers.openai_functions"
|
||||
),
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"OpenAIMetadataTagger",
|
||||
"create_metadata_tagger",
|
||||
]
|
||||
|
Loading…
Reference in New Issue