Apply patch [skip ci]

This commit is contained in:
open-swe[bot] 2025-07-31 00:20:47 +00:00
parent a5ce851693
commit 67380e040c

View File

@ -1,3 +1,23 @@
"""Deprecated module for sentence transformer embeddings.
This module previously provided SentenceTransformerEmbeddings which used the
sentence-transformers library. The sentence-transformers dependency has been removed
from LangChain.
For embedding functionality, please use:
- HuggingFaceEmbeddings from langchain_huggingface which now uses transformers directly
- Or install langchain-community which may still contain the legacy implementation
Example migration:
# Old way (deprecated):
# from langchain.embeddings import SentenceTransformerEmbeddings
# embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
# New way:
from langchain_huggingface import HuggingFaceEmbeddings
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
"""
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
@ -19,3 +39,4 @@ def __getattr__(name: str) -> Any:
__all__ = ["SentenceTransformerEmbeddings"]