File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1
1
"""Wrappers around embedding modules."""
2
+ import logging
3
+ from typing import Any
4
+
2
5
from langchain .embeddings .cohere import CohereEmbeddings
3
6
from langchain .embeddings .huggingface import HuggingFaceEmbeddings
4
7
from langchain .embeddings .huggingface_hub import HuggingFaceHubEmbeddings
5
8
from langchain .embeddings .openai import OpenAIEmbeddings
6
9
10
+ logger = logging .getLogger (__name__ )
11
+
7
12
__all__ = [
8
13
"OpenAIEmbeddings" ,
9
14
"HuggingFaceEmbeddings" ,
10
15
"CohereEmbeddings" ,
11
16
"HuggingFaceHubEmbeddings" ,
12
17
]
18
+
19
+
20
+ # TODO: this is in here to maintain backwards compatibility
21
+ class HypotheticalDocumentEmbedder :
22
+ def __init__ (self , * args : Any , ** kwargs : Any ):
23
+ logger .warning (
24
+ "Using a deprecated class. Please use "
25
+ "`from langchain.chains import HypotheticalDocumentEmbedder` instead"
26
+ )
27
+ from langchain .chains .hyde .base import HypotheticalDocumentEmbedder as H
28
+
29
+ return H (* args , ** kwargs ) # type: ignore
30
+
31
+ @classmethod
32
+ def from_llm (cls , * args : Any , ** kwargs : Any ) -> Any :
33
+ logger .warning (
34
+ "Using a deprecated class. Please use "
35
+ "`from langchain.chains import HypotheticalDocumentEmbedder` instead"
36
+ )
37
+ from langchain .chains .hyde .base import HypotheticalDocumentEmbedder as H
38
+
39
+ return H .from_llm (* args , ** kwargs )
You can’t perform that action at this time.
0 commit comments