mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 06:53:16 +00:00
community[patch]: deprecate ErnieBotChat and ErnieEmbeddings classes (#15862)
- **Description:** add deprecated warning for ErnieBotChat and ErnieEmbeddings. - These two classes **lack maintenance** and do not use the sdk provided by qianfan, which means hard to implement some key feature like streaming. - The alternative `langchain_community.chat_models.QianfanChatEndpoint` and `langchain_community.embeddings.QianfanEmbeddingsEndpoint` can completely replace these two classes, only need to change configuration items. - **Issue:** None, - **Dependencies:** None, - **Twitter handle:** None --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import threading
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
import requests
|
||||
from langchain_core._api.deprecation import deprecated
|
||||
from langchain_core.embeddings import Embeddings
|
||||
from langchain_core.pydantic_v1 import BaseModel, root_validator
|
||||
from langchain_core.runnables.config import run_in_executor
|
||||
@@ -12,6 +13,10 @@ from langchain_core.utils import get_from_dict_or_env
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@deprecated(
|
||||
since="0.0.13",
|
||||
alternative="langchain_community.embeddings.QianfanEmbeddingsEndpoint",
|
||||
)
|
||||
class ErnieEmbeddings(BaseModel, Embeddings):
|
||||
"""`Ernie Embeddings V1` embedding models."""
|
||||
|
||||
|
Reference in New Issue
Block a user