mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-28 18:48:50 +00:00
langchain[patch]: Migrate embeddings to optional imports (#21099)
This commit is contained in:
parent
2f709d94d7
commit
59f10ab3e0
@ -12,90 +12,71 @@ from different APIs and services.
|
||||
|
||||
|
||||
import logging
|
||||
import warnings
|
||||
from typing import Any
|
||||
|
||||
from langchain_core._api import LangChainDeprecationWarning
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain._api import create_importer
|
||||
from langchain.embeddings.cache import CacheBackedEmbeddings
|
||||
from langchain.utils.interactive_env import is_interactive_env
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
from langchain_community import embeddings
|
||||
|
||||
# If not in interactive env, raise warning.
|
||||
if not is_interactive_env():
|
||||
warnings.warn(
|
||||
"Importing embeddings from langchain is deprecated. Importing from "
|
||||
"langchain will no longer be supported as of langchain==0.2.0. "
|
||||
"Please import from langchain-community instead:\n\n"
|
||||
f"`from langchain_community.embeddings import {name}`.\n\n"
|
||||
"To install langchain-community run `pip install -U langchain-community`.",
|
||||
category=LangChainDeprecationWarning,
|
||||
)
|
||||
|
||||
return getattr(embeddings, name)
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import (
|
||||
AlephAlphaAsymmetricSemanticEmbedding,
|
||||
AlephAlphaSymmetricSemanticEmbedding,
|
||||
AwaEmbeddings,
|
||||
AzureOpenAIEmbeddings,
|
||||
BedrockEmbeddings,
|
||||
BookendEmbeddings,
|
||||
ClarifaiEmbeddings,
|
||||
CohereEmbeddings,
|
||||
DashScopeEmbeddings,
|
||||
DatabricksEmbeddings,
|
||||
DeepInfraEmbeddings,
|
||||
DeterministicFakeEmbedding,
|
||||
EdenAiEmbeddings,
|
||||
ElasticsearchEmbeddings,
|
||||
EmbaasEmbeddings,
|
||||
ErnieEmbeddings,
|
||||
FakeEmbeddings,
|
||||
FastEmbedEmbeddings,
|
||||
GooglePalmEmbeddings,
|
||||
GPT4AllEmbeddings,
|
||||
GradientEmbeddings,
|
||||
HuggingFaceBgeEmbeddings,
|
||||
HuggingFaceEmbeddings,
|
||||
HuggingFaceHubEmbeddings,
|
||||
HuggingFaceInferenceAPIEmbeddings,
|
||||
HuggingFaceInstructEmbeddings,
|
||||
InfinityEmbeddings,
|
||||
JavelinAIGatewayEmbeddings,
|
||||
JinaEmbeddings,
|
||||
JohnSnowLabsEmbeddings,
|
||||
LlamaCppEmbeddings,
|
||||
LocalAIEmbeddings,
|
||||
MiniMaxEmbeddings,
|
||||
MlflowAIGatewayEmbeddings,
|
||||
MlflowEmbeddings,
|
||||
ModelScopeEmbeddings,
|
||||
MosaicMLInstructorEmbeddings,
|
||||
NLPCloudEmbeddings,
|
||||
OctoAIEmbeddings,
|
||||
OllamaEmbeddings,
|
||||
OpenAIEmbeddings,
|
||||
OpenVINOEmbeddings,
|
||||
QianfanEmbeddingsEndpoint,
|
||||
SagemakerEndpointEmbeddings,
|
||||
SelfHostedEmbeddings,
|
||||
SelfHostedHuggingFaceEmbeddings,
|
||||
SelfHostedHuggingFaceInstructEmbeddings,
|
||||
SentenceTransformerEmbeddings,
|
||||
SpacyEmbeddings,
|
||||
TensorflowHubEmbeddings,
|
||||
VertexAIEmbeddings,
|
||||
VoyageEmbeddings,
|
||||
XinferenceEmbeddings,
|
||||
)
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
__all__ = [
|
||||
"OpenAIEmbeddings",
|
||||
"AzureOpenAIEmbeddings",
|
||||
"CacheBackedEmbeddings",
|
||||
"ClarifaiEmbeddings",
|
||||
"CohereEmbeddings",
|
||||
"DatabricksEmbeddings",
|
||||
"ElasticsearchEmbeddings",
|
||||
"FastEmbedEmbeddings",
|
||||
"HuggingFaceEmbeddings",
|
||||
"HuggingFaceInferenceAPIEmbeddings",
|
||||
"InfinityEmbeddings",
|
||||
"GradientEmbeddings",
|
||||
"JinaEmbeddings",
|
||||
"LlamaCppEmbeddings",
|
||||
"HuggingFaceHubEmbeddings",
|
||||
"MlflowEmbeddings",
|
||||
"MlflowAIGatewayEmbeddings",
|
||||
"ModelScopeEmbeddings",
|
||||
"TensorflowHubEmbeddings",
|
||||
"SagemakerEndpointEmbeddings",
|
||||
"HuggingFaceInstructEmbeddings",
|
||||
"MosaicMLInstructorEmbeddings",
|
||||
"SelfHostedEmbeddings",
|
||||
"SelfHostedHuggingFaceEmbeddings",
|
||||
"SelfHostedHuggingFaceInstructEmbeddings",
|
||||
"FakeEmbeddings",
|
||||
"DeterministicFakeEmbedding",
|
||||
"AlephAlphaAsymmetricSemanticEmbedding",
|
||||
"AlephAlphaSymmetricSemanticEmbedding",
|
||||
"SentenceTransformerEmbeddings",
|
||||
"GooglePalmEmbeddings",
|
||||
"MiniMaxEmbeddings",
|
||||
"VertexAIEmbeddings",
|
||||
"BedrockEmbeddings",
|
||||
"DeepInfraEmbeddings",
|
||||
"EdenAiEmbeddings",
|
||||
"DashScopeEmbeddings",
|
||||
"EmbaasEmbeddings",
|
||||
"OctoAIEmbeddings",
|
||||
"SpacyEmbeddings",
|
||||
"NLPCloudEmbeddings",
|
||||
"GPT4AllEmbeddings",
|
||||
"XinferenceEmbeddings",
|
||||
"LocalAIEmbeddings",
|
||||
"AwaEmbeddings",
|
||||
"HuggingFaceBgeEmbeddings",
|
||||
"ErnieEmbeddings",
|
||||
"JavelinAIGatewayEmbeddings",
|
||||
"OllamaEmbeddings",
|
||||
"QianfanEmbeddingsEndpoint",
|
||||
"JohnSnowLabsEmbeddings",
|
||||
"VoyageEmbeddings",
|
||||
"BookendEmbeddings",
|
||||
]
|
||||
|
||||
|
||||
# TODO: this is in here to maintain backwards compatibility
|
||||
class HypotheticalDocumentEmbedder:
|
||||
@ -117,3 +98,128 @@ class HypotheticalDocumentEmbedder:
|
||||
from langchain.chains.hyde.base import HypotheticalDocumentEmbedder as H
|
||||
|
||||
return H.from_llm(*args, **kwargs)
|
||||
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"AlephAlphaAsymmetricSemanticEmbedding": "langchain_community.embeddings",
|
||||
"AlephAlphaSymmetricSemanticEmbedding": "langchain_community.embeddings",
|
||||
"AwaEmbeddings": "langchain_community.embeddings",
|
||||
"AzureOpenAIEmbeddings": "langchain_community.embeddings",
|
||||
"BedrockEmbeddings": "langchain_community.embeddings",
|
||||
"BookendEmbeddings": "langchain_community.embeddings",
|
||||
"ClarifaiEmbeddings": "langchain_community.embeddings",
|
||||
"CohereEmbeddings": "langchain_community.embeddings",
|
||||
"DashScopeEmbeddings": "langchain_community.embeddings",
|
||||
"DatabricksEmbeddings": "langchain_community.embeddings",
|
||||
"DeepInfraEmbeddings": "langchain_community.embeddings",
|
||||
"DeterministicFakeEmbedding": "langchain_community.embeddings",
|
||||
"EdenAiEmbeddings": "langchain_community.embeddings",
|
||||
"ElasticsearchEmbeddings": "langchain_community.embeddings",
|
||||
"EmbaasEmbeddings": "langchain_community.embeddings",
|
||||
"ErnieEmbeddings": "langchain_community.embeddings",
|
||||
"FakeEmbeddings": "langchain_community.embeddings",
|
||||
"FastEmbedEmbeddings": "langchain_community.embeddings",
|
||||
"GooglePalmEmbeddings": "langchain_community.embeddings",
|
||||
"GPT4AllEmbeddings": "langchain_community.embeddings",
|
||||
"GradientEmbeddings": "langchain_community.embeddings",
|
||||
"HuggingFaceBgeEmbeddings": "langchain_community.embeddings",
|
||||
"HuggingFaceEmbeddings": "langchain_community.embeddings",
|
||||
"HuggingFaceHubEmbeddings": "langchain_community.embeddings",
|
||||
"HuggingFaceInferenceAPIEmbeddings": "langchain_community.embeddings",
|
||||
"HuggingFaceInstructEmbeddings": "langchain_community.embeddings",
|
||||
"InfinityEmbeddings": "langchain_community.embeddings",
|
||||
"JavelinAIGatewayEmbeddings": "langchain_community.embeddings",
|
||||
"JinaEmbeddings": "langchain_community.embeddings",
|
||||
"JohnSnowLabsEmbeddings": "langchain_community.embeddings",
|
||||
"LlamaCppEmbeddings": "langchain_community.embeddings",
|
||||
"LocalAIEmbeddings": "langchain_community.embeddings",
|
||||
"MiniMaxEmbeddings": "langchain_community.embeddings",
|
||||
"MlflowAIGatewayEmbeddings": "langchain_community.embeddings",
|
||||
"MlflowEmbeddings": "langchain_community.embeddings",
|
||||
"ModelScopeEmbeddings": "langchain_community.embeddings",
|
||||
"MosaicMLInstructorEmbeddings": "langchain_community.embeddings",
|
||||
"NLPCloudEmbeddings": "langchain_community.embeddings",
|
||||
"OctoAIEmbeddings": "langchain_community.embeddings",
|
||||
"OllamaEmbeddings": "langchain_community.embeddings",
|
||||
"OpenAIEmbeddings": "langchain_community.embeddings",
|
||||
"OpenVINOEmbeddings": "langchain_community.embeddings",
|
||||
"QianfanEmbeddingsEndpoint": "langchain_community.embeddings",
|
||||
"SagemakerEndpointEmbeddings": "langchain_community.embeddings",
|
||||
"SelfHostedEmbeddings": "langchain_community.embeddings",
|
||||
"SelfHostedHuggingFaceEmbeddings": "langchain_community.embeddings",
|
||||
"SelfHostedHuggingFaceInstructEmbeddings": "langchain_community.embeddings",
|
||||
"SentenceTransformerEmbeddings": "langchain_community.embeddings",
|
||||
"SpacyEmbeddings": "langchain_community.embeddings",
|
||||
"TensorflowHubEmbeddings": "langchain_community.embeddings",
|
||||
"VertexAIEmbeddings": "langchain_community.embeddings",
|
||||
"VoyageEmbeddings": "langchain_community.embeddings",
|
||||
"XinferenceEmbeddings": "langchain_community.embeddings",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"AlephAlphaAsymmetricSemanticEmbedding",
|
||||
"AlephAlphaSymmetricSemanticEmbedding",
|
||||
"AwaEmbeddings",
|
||||
"AzureOpenAIEmbeddings",
|
||||
"BedrockEmbeddings",
|
||||
"BookendEmbeddings",
|
||||
"CacheBackedEmbeddings",
|
||||
"ClarifaiEmbeddings",
|
||||
"CohereEmbeddings",
|
||||
"DashScopeEmbeddings",
|
||||
"DatabricksEmbeddings",
|
||||
"DeepInfraEmbeddings",
|
||||
"DeterministicFakeEmbedding",
|
||||
"EdenAiEmbeddings",
|
||||
"ElasticsearchEmbeddings",
|
||||
"EmbaasEmbeddings",
|
||||
"ErnieEmbeddings",
|
||||
"FakeEmbeddings",
|
||||
"FastEmbedEmbeddings",
|
||||
"GooglePalmEmbeddings",
|
||||
"GPT4AllEmbeddings",
|
||||
"GradientEmbeddings",
|
||||
"HuggingFaceBgeEmbeddings",
|
||||
"HuggingFaceEmbeddings",
|
||||
"HuggingFaceHubEmbeddings",
|
||||
"HuggingFaceInferenceAPIEmbeddings",
|
||||
"HuggingFaceInstructEmbeddings",
|
||||
"InfinityEmbeddings",
|
||||
"JavelinAIGatewayEmbeddings",
|
||||
"JinaEmbeddings",
|
||||
"JohnSnowLabsEmbeddings",
|
||||
"LlamaCppEmbeddings",
|
||||
"LocalAIEmbeddings",
|
||||
"MiniMaxEmbeddings",
|
||||
"MlflowAIGatewayEmbeddings",
|
||||
"MlflowEmbeddings",
|
||||
"ModelScopeEmbeddings",
|
||||
"MosaicMLInstructorEmbeddings",
|
||||
"NLPCloudEmbeddings",
|
||||
"OctoAIEmbeddings",
|
||||
"OllamaEmbeddings",
|
||||
"OpenAIEmbeddings",
|
||||
"OpenVINOEmbeddings",
|
||||
"QianfanEmbeddingsEndpoint",
|
||||
"SagemakerEndpointEmbeddings",
|
||||
"SelfHostedEmbeddings",
|
||||
"SelfHostedHuggingFaceEmbeddings",
|
||||
"SelfHostedHuggingFaceInstructEmbeddings",
|
||||
"SentenceTransformerEmbeddings",
|
||||
"SpacyEmbeddings",
|
||||
"TensorflowHubEmbeddings",
|
||||
"VertexAIEmbeddings",
|
||||
"VoyageEmbeddings",
|
||||
"XinferenceEmbeddings",
|
||||
]
|
||||
|
@ -1,7 +1,28 @@
|
||||
from langchain_community.embeddings.aleph_alpha import (
|
||||
AlephAlphaAsymmetricSemanticEmbedding,
|
||||
AlephAlphaSymmetricSemanticEmbedding,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import (
|
||||
AlephAlphaAsymmetricSemanticEmbedding,
|
||||
AlephAlphaSymmetricSemanticEmbedding,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"AlephAlphaAsymmetricSemanticEmbedding": "langchain_community.embeddings",
|
||||
"AlephAlphaSymmetricSemanticEmbedding": "langchain_community.embeddings",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"AlephAlphaAsymmetricSemanticEmbedding",
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.awa import AwaEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["AwaEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import AwaEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"AwaEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"AwaEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.azure_openai import AzureOpenAIEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["AzureOpenAIEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import AzureOpenAIEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"AzureOpenAIEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"AzureOpenAIEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.baidu_qianfan_endpoint import (
|
||||
QianfanEmbeddingsEndpoint,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["QianfanEmbeddingsEndpoint"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import QianfanEmbeddingsEndpoint
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"QianfanEmbeddingsEndpoint": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"QianfanEmbeddingsEndpoint",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.bedrock import BedrockEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["BedrockEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import BedrockEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"BedrockEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"BedrockEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.bookend import (
|
||||
BookendEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["BookendEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import BookendEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"BookendEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"BookendEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.clarifai import ClarifaiEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["ClarifaiEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import ClarifaiEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"ClarifaiEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"ClarifaiEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,29 @@
|
||||
from langchain_community.embeddings.cloudflare_workersai import (
|
||||
CloudflareWorkersAIEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["CloudflareWorkersAIEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings.cloudflare_workersai import (
|
||||
CloudflareWorkersAIEmbeddings,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"CloudflareWorkersAIEmbeddings": (
|
||||
"langchain_community.embeddings.cloudflare_workersai"
|
||||
),
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"CloudflareWorkersAIEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.cohere import CohereEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["CohereEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import CohereEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"CohereEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"CohereEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.dashscope import (
|
||||
DashScopeEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["DashScopeEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import DashScopeEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"DashScopeEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DashScopeEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.databricks import DatabricksEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["DatabricksEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import DatabricksEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"DatabricksEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DatabricksEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.deepinfra import (
|
||||
DeepInfraEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["DeepInfraEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import DeepInfraEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"DeepInfraEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DeepInfraEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.edenai import EdenAiEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["EdenAiEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import EdenAiEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"EdenAiEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"EdenAiEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.elasticsearch import ElasticsearchEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["ElasticsearchEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import ElasticsearchEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"ElasticsearchEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"ElasticsearchEmbeddings",
|
||||
]
|
||||
|
@ -1,6 +1,22 @@
|
||||
from langchain_community.embeddings.embaas import (
|
||||
EmbaasEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import EmbaasEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"EmbaasEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"EmbaasEmbeddings",
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.ernie import ErnieEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["ErnieEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import ErnieEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"ErnieEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"ErnieEmbeddings",
|
||||
]
|
||||
|
@ -1,6 +1,30 @@
|
||||
from langchain_community.embeddings.fake import (
|
||||
DeterministicFakeEmbedding,
|
||||
FakeEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["FakeEmbeddings", "DeterministicFakeEmbedding"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import (
|
||||
DeterministicFakeEmbedding,
|
||||
FakeEmbeddings,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"FakeEmbeddings": "langchain_community.embeddings",
|
||||
"DeterministicFakeEmbedding": "langchain_community.embeddings",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"FakeEmbeddings",
|
||||
"DeterministicFakeEmbedding",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.fastembed import FastEmbedEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["FastEmbedEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import FastEmbedEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"FastEmbedEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"FastEmbedEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.google_palm import (
|
||||
GooglePalmEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["GooglePalmEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import GooglePalmEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"GooglePalmEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"GooglePalmEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.gpt4all import GPT4AllEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["GPT4AllEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import GPT4AllEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"GPT4AllEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"GPT4AllEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.gradient_ai import GradientEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["GradientEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import GradientEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"GradientEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"GradientEmbeddings",
|
||||
]
|
||||
|
@ -1,9 +1,32 @@
|
||||
from langchain_community.embeddings.huggingface import (
|
||||
HuggingFaceBgeEmbeddings,
|
||||
HuggingFaceEmbeddings,
|
||||
HuggingFaceInferenceAPIEmbeddings,
|
||||
HuggingFaceInstructEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import (
|
||||
HuggingFaceBgeEmbeddings,
|
||||
HuggingFaceEmbeddings,
|
||||
HuggingFaceInferenceAPIEmbeddings,
|
||||
HuggingFaceInstructEmbeddings,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"HuggingFaceEmbeddings": "langchain_community.embeddings",
|
||||
"HuggingFaceInstructEmbeddings": "langchain_community.embeddings",
|
||||
"HuggingFaceBgeEmbeddings": "langchain_community.embeddings",
|
||||
"HuggingFaceInferenceAPIEmbeddings": "langchain_community.embeddings",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"HuggingFaceEmbeddings",
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.huggingface_hub import (
|
||||
HuggingFaceHubEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["HuggingFaceHubEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import HuggingFaceHubEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"HuggingFaceHubEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"HuggingFaceHubEmbeddings",
|
||||
]
|
||||
|
@ -1,6 +1,30 @@
|
||||
from langchain_community.embeddings.infinity import (
|
||||
InfinityEmbeddings,
|
||||
TinyAsyncOpenAIInfinityEmbeddingClient,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["InfinityEmbeddings", "TinyAsyncOpenAIInfinityEmbeddingClient"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import InfinityEmbeddings
|
||||
from langchain_community.embeddings.infinity import (
|
||||
TinyAsyncOpenAIInfinityEmbeddingClient,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"InfinityEmbeddings": "langchain_community.embeddings",
|
||||
"TinyAsyncOpenAIInfinityEmbeddingClient": "langchain_community.embeddings.infinity",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"InfinityEmbeddings",
|
||||
"TinyAsyncOpenAIInfinityEmbeddingClient",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.javelin_ai_gateway import (
|
||||
JavelinAIGatewayEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["JavelinAIGatewayEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import JavelinAIGatewayEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"JavelinAIGatewayEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"JavelinAIGatewayEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.jina import JinaEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["JinaEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import JinaEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"JinaEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"JinaEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.johnsnowlabs import JohnSnowLabsEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["JohnSnowLabsEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import JohnSnowLabsEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"JohnSnowLabsEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"JohnSnowLabsEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.llamacpp import LlamaCppEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["LlamaCppEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import LlamaCppEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"LlamaCppEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"LlamaCppEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.llm_rails import LLMRailsEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["LLMRailsEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import LLMRailsEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"LLMRailsEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"LLMRailsEmbeddings",
|
||||
]
|
||||
|
@ -1,6 +1,22 @@
|
||||
from langchain_community.embeddings.localai import (
|
||||
LocalAIEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import LocalAIEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"LocalAIEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"LocalAIEmbeddings",
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.minimax import (
|
||||
MiniMaxEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["MiniMaxEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import MiniMaxEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"MiniMaxEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"MiniMaxEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.mlflow import MlflowEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["MlflowEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import MlflowEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"MlflowEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"MlflowEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.mlflow_gateway import (
|
||||
MlflowAIGatewayEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["MlflowAIGatewayEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import MlflowAIGatewayEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"MlflowAIGatewayEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"MlflowAIGatewayEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.modelscope_hub import ModelScopeEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["ModelScopeEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import ModelScopeEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"ModelScopeEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"ModelScopeEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.mosaicml import MosaicMLInstructorEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["MosaicMLInstructorEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import MosaicMLInstructorEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"MosaicMLInstructorEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"MosaicMLInstructorEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.nlpcloud import NLPCloudEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["NLPCloudEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import NLPCloudEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"NLPCloudEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"NLPCloudEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.octoai_embeddings import (
|
||||
OctoAIEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["OctoAIEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import OctoAIEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"OctoAIEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"OctoAIEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.ollama import OllamaEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["OllamaEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import OllamaEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"OllamaEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"OllamaEmbeddings",
|
||||
]
|
||||
|
@ -1,6 +1,22 @@
|
||||
from langchain_community.embeddings.openai import (
|
||||
OpenAIEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import OpenAIEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"OpenAIEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"OpenAIEmbeddings",
|
||||
|
@ -1,6 +1,30 @@
|
||||
from langchain_community.embeddings.sagemaker_endpoint import (
|
||||
EmbeddingsContentHandler,
|
||||
SagemakerEndpointEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["EmbeddingsContentHandler", "SagemakerEndpointEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import SagemakerEndpointEmbeddings
|
||||
from langchain_community.embeddings.sagemaker_endpoint import (
|
||||
EmbeddingsContentHandler,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"EmbeddingsContentHandler": "langchain_community.embeddings.sagemaker_endpoint",
|
||||
"SagemakerEndpointEmbeddings": "langchain_community.embeddings",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"EmbeddingsContentHandler",
|
||||
"SagemakerEndpointEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.self_hosted import (
|
||||
SelfHostedEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["SelfHostedEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import SelfHostedEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"SelfHostedEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"SelfHostedEmbeddings",
|
||||
]
|
||||
|
@ -1,7 +1,28 @@
|
||||
from langchain_community.embeddings.self_hosted_hugging_face import (
|
||||
SelfHostedHuggingFaceEmbeddings,
|
||||
SelfHostedHuggingFaceInstructEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import (
|
||||
SelfHostedHuggingFaceEmbeddings,
|
||||
SelfHostedHuggingFaceInstructEmbeddings,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"SelfHostedHuggingFaceEmbeddings": "langchain_community.embeddings",
|
||||
"SelfHostedHuggingFaceInstructEmbeddings": "langchain_community.embeddings",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"SelfHostedHuggingFaceEmbeddings",
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.spacy_embeddings import SpacyEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["SpacyEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import SpacyEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"SpacyEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"SpacyEmbeddings",
|
||||
]
|
||||
|
@ -1,5 +1,23 @@
|
||||
from langchain_community.embeddings.tensorflow_hub import (
|
||||
TensorflowHubEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["TensorflowHubEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import TensorflowHubEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"TensorflowHubEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"TensorflowHubEmbeddings",
|
||||
]
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.vertexai import VertexAIEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["VertexAIEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import VertexAIEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"VertexAIEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"VertexAIEmbeddings",
|
||||
]
|
||||
|
@ -1,6 +1,22 @@
|
||||
from langchain_community.embeddings.voyageai import (
|
||||
VoyageEmbeddings,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import VoyageEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"VoyageEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"VoyageEmbeddings",
|
||||
|
@ -1,3 +1,23 @@
|
||||
from langchain_community.embeddings.xinference import XinferenceEmbeddings
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
__all__ = ["XinferenceEmbeddings"]
|
||||
from langchain._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.embeddings import XinferenceEmbeddings
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"XinferenceEmbeddings": "langchain_community.embeddings"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"XinferenceEmbeddings",
|
||||
]
|
||||
|
@ -44,6 +44,7 @@ EXPECTED_ALL = [
|
||||
"SpacyEmbeddings",
|
||||
"NLPCloudEmbeddings",
|
||||
"GPT4AllEmbeddings",
|
||||
"OpenVINOEmbeddings",
|
||||
"XinferenceEmbeddings",
|
||||
"LocalAIEmbeddings",
|
||||
"AwaEmbeddings",
|
||||
|
Loading…
Reference in New Issue
Block a user