2023-12-11 21:53:30 +00:00
|
|
|
"""**Embedding models** are wrappers around embedding models
|
|
|
|
from different APIs and services.
|
|
|
|
|
|
|
|
**Embedding models** can be LLMs or not.
|
|
|
|
|
|
|
|
**Class hierarchy:**
|
|
|
|
|
|
|
|
.. code-block::
|
|
|
|
|
|
|
|
Embeddings --> <name>Embeddings # Examples: OpenAIEmbeddings, HuggingFaceEmbeddings
|
|
|
|
"""
|
|
|
|
|
2024-03-12 22:18:54 +00:00
|
|
|
import importlib
|
2023-12-11 21:53:30 +00:00
|
|
|
import logging
|
2024-04-10 17:01:19 +00:00
|
|
|
from typing import TYPE_CHECKING, Any
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
from langchain_community.embeddings.aleph_alpha import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AlephAlphaAsymmetricSemanticEmbedding,
|
|
|
|
AlephAlphaSymmetricSemanticEmbedding,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.anyscale import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AnyscaleEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.awa import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AwaEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.azure_openai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AzureOpenAIEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.baichuan import (
|
2024-04-30 17:13:48 +00:00
|
|
|
BaichuanTextEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.baidu_qianfan_endpoint import (
|
2024-04-30 17:13:48 +00:00
|
|
|
QianfanEmbeddingsEndpoint,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.bedrock import (
|
2024-04-30 17:13:48 +00:00
|
|
|
BedrockEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.bookend import (
|
2024-04-30 17:13:48 +00:00
|
|
|
BookendEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.clarifai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ClarifaiEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
2024-05-22 22:08:47 +00:00
|
|
|
from langchain_community.embeddings.clova import (
|
|
|
|
ClovaEmbeddings,
|
|
|
|
)
|
2024-04-10 17:01:19 +00:00
|
|
|
from langchain_community.embeddings.cohere import (
|
2024-04-30 17:13:48 +00:00
|
|
|
CohereEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.dashscope import (
|
2024-04-30 17:13:48 +00:00
|
|
|
DashScopeEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.databricks import (
|
2024-04-30 17:13:48 +00:00
|
|
|
DatabricksEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.deepinfra import (
|
2024-04-30 17:13:48 +00:00
|
|
|
DeepInfraEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.edenai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
EdenAiEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.elasticsearch import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ElasticsearchEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.embaas import (
|
2024-04-30 17:13:48 +00:00
|
|
|
EmbaasEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.ernie import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ErnieEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.fake import (
|
2024-04-30 17:13:48 +00:00
|
|
|
DeterministicFakeEmbedding,
|
|
|
|
FakeEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.fastembed import (
|
2024-04-30 17:13:48 +00:00
|
|
|
FastEmbedEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.gigachat import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GigaChatEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.google_palm import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GooglePalmEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.gpt4all import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GPT4AllEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.gradient_ai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GradientEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.huggingface import (
|
2024-04-30 17:13:48 +00:00
|
|
|
HuggingFaceBgeEmbeddings,
|
|
|
|
HuggingFaceEmbeddings,
|
|
|
|
HuggingFaceInferenceAPIEmbeddings,
|
|
|
|
HuggingFaceInstructEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.huggingface_hub import (
|
2024-04-30 17:13:48 +00:00
|
|
|
HuggingFaceHubEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.infinity import (
|
2024-04-30 17:13:48 +00:00
|
|
|
InfinityEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.infinity_local import (
|
2024-04-30 17:13:48 +00:00
|
|
|
InfinityEmbeddingsLocal,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
2024-06-03 19:37:10 +00:00
|
|
|
from langchain_community.embeddings.ipex_llm import IpexLLMBgeEmbeddings
|
2024-04-10 17:01:19 +00:00
|
|
|
from langchain_community.embeddings.itrex import (
|
2024-04-30 17:13:48 +00:00
|
|
|
QuantizedBgeEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.javelin_ai_gateway import (
|
2024-04-30 17:13:48 +00:00
|
|
|
JavelinAIGatewayEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.jina import (
|
2024-04-30 17:13:48 +00:00
|
|
|
JinaEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.johnsnowlabs import (
|
2024-04-30 17:13:48 +00:00
|
|
|
JohnSnowLabsEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.laser import (
|
2024-04-30 17:13:48 +00:00
|
|
|
LaserEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.llamacpp import (
|
2024-04-30 17:13:48 +00:00
|
|
|
LlamaCppEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.llamafile import (
|
2024-04-30 17:13:48 +00:00
|
|
|
LlamafileEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.llm_rails import (
|
2024-04-30 17:13:48 +00:00
|
|
|
LLMRailsEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.localai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
LocalAIEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.minimax import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MiniMaxEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.mlflow import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MlflowCohereEmbeddings,
|
|
|
|
MlflowEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.mlflow_gateway import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MlflowAIGatewayEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.modelscope_hub import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ModelScopeEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.mosaicml import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MosaicMLInstructorEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.nemo import (
|
2024-04-30 17:13:48 +00:00
|
|
|
NeMoEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.nlpcloud import (
|
2024-04-30 17:13:48 +00:00
|
|
|
NLPCloudEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.oci_generative_ai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
OCIGenAIEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.octoai_embeddings import (
|
2024-04-30 17:13:48 +00:00
|
|
|
OctoAIEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.ollama import (
|
2024-04-30 17:13:48 +00:00
|
|
|
OllamaEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.openai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
OpenAIEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.openvino import (
|
2024-04-30 17:13:48 +00:00
|
|
|
OpenVINOBgeEmbeddings,
|
|
|
|
OpenVINOEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.optimum_intel import (
|
2024-04-30 17:13:48 +00:00
|
|
|
QuantizedBiEncoderEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
2024-05-04 03:15:35 +00:00
|
|
|
from langchain_community.embeddings.oracleai import (
|
2024-05-22 22:21:08 +00:00
|
|
|
OracleEmbeddings,
|
2024-05-04 03:15:35 +00:00
|
|
|
)
|
2024-06-10 21:07:25 +00:00
|
|
|
from langchain_community.embeddings.ovhcloud import (
|
|
|
|
OVHCloudEmbeddings,
|
|
|
|
)
|
2024-04-10 17:01:19 +00:00
|
|
|
from langchain_community.embeddings.premai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
PremAIEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.sagemaker_endpoint import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SagemakerEndpointEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
2024-05-06 20:29:59 +00:00
|
|
|
from langchain_community.embeddings.sambanova import (
|
|
|
|
SambaStudioEmbeddings,
|
|
|
|
)
|
2024-04-10 17:01:19 +00:00
|
|
|
from langchain_community.embeddings.self_hosted import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SelfHostedEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.self_hosted_hugging_face import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SelfHostedHuggingFaceEmbeddings,
|
|
|
|
SelfHostedHuggingFaceInstructEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.sentence_transformer import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SentenceTransformerEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.solar import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SolarEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.spacy_embeddings import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SpacyEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.sparkllm import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SparkLLMTextEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.tensorflow_hub import (
|
2024-04-30 17:13:48 +00:00
|
|
|
TensorflowHubEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
2024-05-22 15:42:15 +00:00
|
|
|
from langchain_community.embeddings.titan_takeoff import (
|
|
|
|
TitanTakeoffEmbed,
|
|
|
|
)
|
2024-04-10 17:01:19 +00:00
|
|
|
from langchain_community.embeddings.vertexai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
VertexAIEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.volcengine import (
|
2024-04-30 17:13:48 +00:00
|
|
|
VolcanoEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.voyageai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
VoyageEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.xinference import (
|
2024-04-30 17:13:48 +00:00
|
|
|
XinferenceEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.embeddings.yandex import (
|
2024-04-30 17:13:48 +00:00
|
|
|
YandexGPTEmbeddings,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
"AlephAlphaAsymmetricSemanticEmbedding",
|
|
|
|
"AlephAlphaSymmetricSemanticEmbedding",
|
|
|
|
"AnyscaleEmbeddings",
|
|
|
|
"AwaEmbeddings",
|
|
|
|
"AzureOpenAIEmbeddings",
|
|
|
|
"BaichuanTextEmbeddings",
|
|
|
|
"BedrockEmbeddings",
|
|
|
|
"BookendEmbeddings",
|
|
|
|
"ClarifaiEmbeddings",
|
2024-05-22 22:08:47 +00:00
|
|
|
"ClovaEmbeddings",
|
2024-04-10 17:01:19 +00:00
|
|
|
"CohereEmbeddings",
|
|
|
|
"DashScopeEmbeddings",
|
|
|
|
"DatabricksEmbeddings",
|
|
|
|
"DeepInfraEmbeddings",
|
|
|
|
"DeterministicFakeEmbedding",
|
|
|
|
"EdenAiEmbeddings",
|
|
|
|
"ElasticsearchEmbeddings",
|
|
|
|
"EmbaasEmbeddings",
|
|
|
|
"ErnieEmbeddings",
|
|
|
|
"FakeEmbeddings",
|
|
|
|
"FastEmbedEmbeddings",
|
|
|
|
"GPT4AllEmbeddings",
|
|
|
|
"GigaChatEmbeddings",
|
|
|
|
"GooglePalmEmbeddings",
|
|
|
|
"GradientEmbeddings",
|
|
|
|
"HuggingFaceBgeEmbeddings",
|
|
|
|
"HuggingFaceEmbeddings",
|
|
|
|
"HuggingFaceHubEmbeddings",
|
|
|
|
"HuggingFaceInferenceAPIEmbeddings",
|
|
|
|
"HuggingFaceInstructEmbeddings",
|
|
|
|
"InfinityEmbeddings",
|
|
|
|
"InfinityEmbeddingsLocal",
|
2024-06-03 19:37:10 +00:00
|
|
|
"IpexLLMBgeEmbeddings",
|
2024-04-10 17:01:19 +00:00
|
|
|
"JavelinAIGatewayEmbeddings",
|
|
|
|
"JinaEmbeddings",
|
|
|
|
"JohnSnowLabsEmbeddings",
|
|
|
|
"LLMRailsEmbeddings",
|
|
|
|
"LaserEmbeddings",
|
|
|
|
"LlamaCppEmbeddings",
|
|
|
|
"LlamafileEmbeddings",
|
|
|
|
"LocalAIEmbeddings",
|
|
|
|
"MiniMaxEmbeddings",
|
|
|
|
"MlflowAIGatewayEmbeddings",
|
|
|
|
"MlflowCohereEmbeddings",
|
|
|
|
"MlflowEmbeddings",
|
|
|
|
"ModelScopeEmbeddings",
|
|
|
|
"MosaicMLInstructorEmbeddings",
|
|
|
|
"NLPCloudEmbeddings",
|
|
|
|
"NeMoEmbeddings",
|
|
|
|
"OCIGenAIEmbeddings",
|
|
|
|
"OctoAIEmbeddings",
|
|
|
|
"OllamaEmbeddings",
|
|
|
|
"OpenAIEmbeddings",
|
|
|
|
"OpenVINOBgeEmbeddings",
|
|
|
|
"OpenVINOEmbeddings",
|
2024-05-04 03:15:35 +00:00
|
|
|
"OracleEmbeddings",
|
2024-06-10 21:07:25 +00:00
|
|
|
"OVHCloudEmbeddings",
|
2024-04-10 17:01:19 +00:00
|
|
|
"PremAIEmbeddings",
|
|
|
|
"QianfanEmbeddingsEndpoint",
|
|
|
|
"QuantizedBgeEmbeddings",
|
|
|
|
"QuantizedBiEncoderEmbeddings",
|
|
|
|
"SagemakerEndpointEmbeddings",
|
2024-05-06 20:29:59 +00:00
|
|
|
"SambaStudioEmbeddings",
|
2024-04-10 17:01:19 +00:00
|
|
|
"SelfHostedEmbeddings",
|
|
|
|
"SelfHostedHuggingFaceEmbeddings",
|
|
|
|
"SelfHostedHuggingFaceInstructEmbeddings",
|
|
|
|
"SentenceTransformerEmbeddings",
|
|
|
|
"SolarEmbeddings",
|
|
|
|
"SpacyEmbeddings",
|
|
|
|
"SparkLLMTextEmbeddings",
|
|
|
|
"TensorflowHubEmbeddings",
|
2024-05-22 15:42:15 +00:00
|
|
|
"TitanTakeoffEmbed",
|
2024-04-10 17:01:19 +00:00
|
|
|
"VertexAIEmbeddings",
|
|
|
|
"VolcanoEmbeddings",
|
|
|
|
"VoyageEmbeddings",
|
|
|
|
"XinferenceEmbeddings",
|
|
|
|
"YandexGPTEmbeddings",
|
|
|
|
]
|
2023-12-11 21:53:30 +00:00
|
|
|
|
2024-03-12 22:18:54 +00:00
|
|
|
_module_lookup = {
|
|
|
|
"AlephAlphaAsymmetricSemanticEmbedding": "langchain_community.embeddings.aleph_alpha", # noqa: E501
|
|
|
|
"AlephAlphaSymmetricSemanticEmbedding": "langchain_community.embeddings.aleph_alpha", # noqa: E501
|
2024-03-29 00:53:53 +00:00
|
|
|
"AnyscaleEmbeddings": "langchain_community.embeddings.anyscale",
|
2024-03-12 22:18:54 +00:00
|
|
|
"AwaEmbeddings": "langchain_community.embeddings.awa",
|
|
|
|
"AzureOpenAIEmbeddings": "langchain_community.embeddings.azure_openai",
|
|
|
|
"BaichuanTextEmbeddings": "langchain_community.embeddings.baichuan",
|
|
|
|
"BedrockEmbeddings": "langchain_community.embeddings.bedrock",
|
|
|
|
"BookendEmbeddings": "langchain_community.embeddings.bookend",
|
|
|
|
"ClarifaiEmbeddings": "langchain_community.embeddings.clarifai",
|
2024-05-22 22:08:47 +00:00
|
|
|
"ClovaEmbeddings": "langchain_community.embeddings.clova",
|
2024-03-12 22:18:54 +00:00
|
|
|
"CohereEmbeddings": "langchain_community.embeddings.cohere",
|
|
|
|
"DashScopeEmbeddings": "langchain_community.embeddings.dashscope",
|
|
|
|
"DatabricksEmbeddings": "langchain_community.embeddings.databricks",
|
|
|
|
"DeepInfraEmbeddings": "langchain_community.embeddings.deepinfra",
|
|
|
|
"DeterministicFakeEmbedding": "langchain_community.embeddings.fake",
|
|
|
|
"EdenAiEmbeddings": "langchain_community.embeddings.edenai",
|
|
|
|
"ElasticsearchEmbeddings": "langchain_community.embeddings.elasticsearch",
|
|
|
|
"EmbaasEmbeddings": "langchain_community.embeddings.embaas",
|
|
|
|
"ErnieEmbeddings": "langchain_community.embeddings.ernie",
|
|
|
|
"FakeEmbeddings": "langchain_community.embeddings.fake",
|
|
|
|
"FastEmbedEmbeddings": "langchain_community.embeddings.fastembed",
|
|
|
|
"GPT4AllEmbeddings": "langchain_community.embeddings.gpt4all",
|
|
|
|
"GooglePalmEmbeddings": "langchain_community.embeddings.google_palm",
|
|
|
|
"GradientEmbeddings": "langchain_community.embeddings.gradient_ai",
|
2024-03-25 23:08:37 +00:00
|
|
|
"GigaChatEmbeddings": "langchain_community.embeddings.gigachat",
|
2024-03-12 22:18:54 +00:00
|
|
|
"HuggingFaceBgeEmbeddings": "langchain_community.embeddings.huggingface",
|
|
|
|
"HuggingFaceEmbeddings": "langchain_community.embeddings.huggingface",
|
|
|
|
"HuggingFaceHubEmbeddings": "langchain_community.embeddings.huggingface_hub",
|
|
|
|
"HuggingFaceInferenceAPIEmbeddings": "langchain_community.embeddings.huggingface",
|
|
|
|
"HuggingFaceInstructEmbeddings": "langchain_community.embeddings.huggingface",
|
|
|
|
"InfinityEmbeddings": "langchain_community.embeddings.infinity",
|
|
|
|
"InfinityEmbeddingsLocal": "langchain_community.embeddings.infinity_local",
|
2024-06-03 19:37:10 +00:00
|
|
|
"IpexLLMBgeEmbeddings": "langchain_community.embeddings.ipex_llm",
|
2024-03-12 22:18:54 +00:00
|
|
|
"JavelinAIGatewayEmbeddings": "langchain_community.embeddings.javelin_ai_gateway",
|
|
|
|
"JinaEmbeddings": "langchain_community.embeddings.jina",
|
|
|
|
"JohnSnowLabsEmbeddings": "langchain_community.embeddings.johnsnowlabs",
|
|
|
|
"LLMRailsEmbeddings": "langchain_community.embeddings.llm_rails",
|
|
|
|
"LaserEmbeddings": "langchain_community.embeddings.laser",
|
|
|
|
"LlamaCppEmbeddings": "langchain_community.embeddings.llamacpp",
|
|
|
|
"LlamafileEmbeddings": "langchain_community.embeddings.llamafile",
|
|
|
|
"LocalAIEmbeddings": "langchain_community.embeddings.localai",
|
|
|
|
"MiniMaxEmbeddings": "langchain_community.embeddings.minimax",
|
|
|
|
"MlflowAIGatewayEmbeddings": "langchain_community.embeddings.mlflow_gateway",
|
|
|
|
"MlflowCohereEmbeddings": "langchain_community.embeddings.mlflow",
|
|
|
|
"MlflowEmbeddings": "langchain_community.embeddings.mlflow",
|
|
|
|
"ModelScopeEmbeddings": "langchain_community.embeddings.modelscope_hub",
|
|
|
|
"MosaicMLInstructorEmbeddings": "langchain_community.embeddings.mosaicml",
|
|
|
|
"NLPCloudEmbeddings": "langchain_community.embeddings.nlpcloud",
|
|
|
|
"NeMoEmbeddings": "langchain_community.embeddings.nemo",
|
|
|
|
"OCIGenAIEmbeddings": "langchain_community.embeddings.oci_generative_ai",
|
|
|
|
"OctoAIEmbeddings": "langchain_community.embeddings.octoai_embeddings",
|
|
|
|
"OllamaEmbeddings": "langchain_community.embeddings.ollama",
|
|
|
|
"OpenAIEmbeddings": "langchain_community.embeddings.openai",
|
2024-03-29 08:34:51 +00:00
|
|
|
"OpenVINOEmbeddings": "langchain_community.embeddings.openvino",
|
|
|
|
"OpenVINOBgeEmbeddings": "langchain_community.embeddings.openvino",
|
2024-03-12 22:18:54 +00:00
|
|
|
"QianfanEmbeddingsEndpoint": "langchain_community.embeddings.baidu_qianfan_endpoint", # noqa: E501
|
2024-03-27 07:22:06 +00:00
|
|
|
"QuantizedBgeEmbeddings": "langchain_community.embeddings.itrex",
|
2024-03-12 22:18:54 +00:00
|
|
|
"QuantizedBiEncoderEmbeddings": "langchain_community.embeddings.optimum_intel",
|
2024-05-04 03:15:35 +00:00
|
|
|
"OracleEmbeddings": "langchain_community.embeddings.oracleai",
|
2024-06-10 21:07:25 +00:00
|
|
|
"OVHCloudEmbeddings": "langchain_community.embeddings.ovhcloud",
|
2024-03-12 22:18:54 +00:00
|
|
|
"SagemakerEndpointEmbeddings": "langchain_community.embeddings.sagemaker_endpoint",
|
2024-05-06 20:29:59 +00:00
|
|
|
"SambaStudioEmbeddings": "langchain_community.embeddings.sambanova",
|
2024-03-12 22:18:54 +00:00
|
|
|
"SelfHostedEmbeddings": "langchain_community.embeddings.self_hosted",
|
|
|
|
"SelfHostedHuggingFaceEmbeddings": "langchain_community.embeddings.self_hosted_hugging_face", # noqa: E501
|
|
|
|
"SelfHostedHuggingFaceInstructEmbeddings": "langchain_community.embeddings.self_hosted_hugging_face", # noqa: E501
|
|
|
|
"SentenceTransformerEmbeddings": "langchain_community.embeddings.sentence_transformer", # noqa: E501
|
2024-03-29 16:36:05 +00:00
|
|
|
"SolarEmbeddings": "langchain_community.embeddings.solar",
|
2024-03-12 22:18:54 +00:00
|
|
|
"SpacyEmbeddings": "langchain_community.embeddings.spacy_embeddings",
|
|
|
|
"SparkLLMTextEmbeddings": "langchain_community.embeddings.sparkllm",
|
|
|
|
"TensorflowHubEmbeddings": "langchain_community.embeddings.tensorflow_hub",
|
|
|
|
"VertexAIEmbeddings": "langchain_community.embeddings.vertexai",
|
|
|
|
"VolcanoEmbeddings": "langchain_community.embeddings.volcengine",
|
|
|
|
"VoyageEmbeddings": "langchain_community.embeddings.voyageai",
|
|
|
|
"XinferenceEmbeddings": "langchain_community.embeddings.xinference",
|
2024-04-17 01:43:35 +00:00
|
|
|
"TitanTakeoffEmbed": "langchain_community.embeddings.titan_takeoff",
|
2024-03-26 01:37:19 +00:00
|
|
|
"PremAIEmbeddings": "langchain_community.embeddings.premai",
|
2024-03-26 00:05:57 +00:00
|
|
|
"YandexGPTEmbeddings": "langchain_community.embeddings.yandex",
|
2024-03-12 22:18:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def __getattr__(name: str) -> Any:
|
|
|
|
if name in _module_lookup:
|
|
|
|
module = importlib.import_module(_module_lookup[name])
|
|
|
|
return getattr(module, name)
|
|
|
|
raise AttributeError(f"module {__name__} has no attribute {name}")
|
2023-12-11 21:53:30 +00:00
|
|
|
|
|
|
|
|
2024-03-12 22:18:54 +00:00
|
|
|
logger = logging.getLogger(__name__)
|
2023-12-11 21:53:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# TODO: this is in here to maintain backwards compatibility
|
|
|
|
class HypotheticalDocumentEmbedder:
|
|
|
|
def __init__(self, *args: Any, **kwargs: Any):
|
|
|
|
logger.warning(
|
|
|
|
"Using a deprecated class. Please use "
|
|
|
|
"`from langchain.chains import HypotheticalDocumentEmbedder` instead"
|
|
|
|
)
|
|
|
|
from langchain.chains.hyde.base import HypotheticalDocumentEmbedder as H
|
|
|
|
|
|
|
|
return H(*args, **kwargs) # type: ignore
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def from_llm(cls, *args: Any, **kwargs: Any) -> Any:
|
|
|
|
logger.warning(
|
|
|
|
"Using a deprecated class. Please use "
|
|
|
|
"`from langchain.chains import HypotheticalDocumentEmbedder` instead"
|
|
|
|
)
|
|
|
|
from langchain.chains.hyde.base import HypotheticalDocumentEmbedder as H
|
|
|
|
|
|
|
|
return H.from_llm(*args, **kwargs)
|