community[patch]: deprecate all HF classes (#22444)

This commit is contained in:
Bagatur
2024-06-04 09:48:25 -07:00
committed by GitHub
parent 58b118544e
commit 17c127531a
7 changed files with 25 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
from typing import Any, Dict, List, Optional
import requests
from langchain_core._api import deprecated
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import BaseModel, Extra, Field, SecretStr
@@ -17,6 +18,11 @@ DEFAULT_QUERY_BGE_INSTRUCTION_EN = (
DEFAULT_QUERY_BGE_INSTRUCTION_ZH = "为这个句子生成表示以用于检索相关文章:"
@deprecated(
since="0.2.2",
removal="0.3.0",
alternative_import="from langchain_huggingface import HuggingFaceEmbeddings",
)
class HuggingFaceEmbeddings(BaseModel, Embeddings):
"""HuggingFace sentence_transformers embedding models.