mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-20 03:21:33 +00:00
community: Add deprecation notice for Databricks integration in langchain-community (#27355)
We have released the [langchain-databricks](https://github.com/langchain-ai/langchain-databricks) package for Databricks integration. This PR deprecates the legacy classes within `langchain-community`. --------- Signed-off-by: B-Step62 <yuki.watanabe@databricks.com> Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
parent
15c1ddaf99
commit
b8bfebd382
@ -1,11 +1,18 @@
|
|||||||
import logging
|
import logging
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
|
from langchain_core._api import deprecated
|
||||||
|
|
||||||
from langchain_community.chat_models.mlflow import ChatMlflow
|
from langchain_community.chat_models.mlflow import ChatMlflow
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(
|
||||||
|
since="0.3.3",
|
||||||
|
removal="1.0",
|
||||||
|
alternative_import="langchain_databricks.ChatDatabricks",
|
||||||
|
)
|
||||||
class ChatDatabricks(ChatMlflow):
|
class ChatDatabricks(ChatMlflow):
|
||||||
"""`Databricks` chat models API.
|
"""`Databricks` chat models API.
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||||||
from typing import Iterator, List
|
from typing import Iterator, List
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
|
from langchain_core._api import deprecated
|
||||||
|
|
||||||
from langchain_community.embeddings.mlflow import MlflowEmbeddings
|
from langchain_community.embeddings.mlflow import MlflowEmbeddings
|
||||||
|
|
||||||
|
|
||||||
@ -11,6 +13,11 @@ def _chunk(texts: List[str], size: int) -> Iterator[List[str]]:
|
|||||||
yield texts[i : i + size]
|
yield texts[i : i + size]
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(
|
||||||
|
since="0.3.3",
|
||||||
|
removal="1.0",
|
||||||
|
alternative_import="langchain_databricks.DatabricksEmbeddings",
|
||||||
|
)
|
||||||
class DatabricksEmbeddings(MlflowEmbeddings):
|
class DatabricksEmbeddings(MlflowEmbeddings):
|
||||||
"""Databricks embeddings.
|
"""Databricks embeddings.
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ from abc import ABC, abstractmethod
|
|||||||
from typing import Any, Callable, Dict, List, Mapping, Optional
|
from typing import Any, Callable, Dict, List, Mapping, Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
from langchain_core._api import deprecated
|
||||||
from langchain_core.callbacks import CallbackManagerForLLMRun
|
from langchain_core.callbacks import CallbackManagerForLLMRun
|
||||||
from langchain_core.language_models import LLM
|
from langchain_core.language_models import LLM
|
||||||
from pydantic import (
|
from pydantic import (
|
||||||
@ -262,6 +263,11 @@ def _pickle_fn_to_hex_string(fn: Callable) -> str:
|
|||||||
raise ValueError(f"Failed to pickle the function: {e}")
|
raise ValueError(f"Failed to pickle the function: {e}")
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(
|
||||||
|
since="0.3.3",
|
||||||
|
removal="1.0",
|
||||||
|
alternative_import="langchain_databricks.ChatDatabricks",
|
||||||
|
)
|
||||||
class Databricks(LLM):
|
class Databricks(LLM):
|
||||||
"""Databricks serving endpoint or a cluster driver proxy app for LLM.
|
"""Databricks serving endpoint or a cluster driver proxy app for LLM.
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ from typing import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from langchain_core._api import warn_deprecated
|
from langchain_core._api import deprecated, warn_deprecated
|
||||||
from langchain_core.documents import Document
|
from langchain_core.documents import Document
|
||||||
from langchain_core.embeddings import Embeddings
|
from langchain_core.embeddings import Embeddings
|
||||||
from langchain_core.vectorstores import VST, VectorStore
|
from langchain_core.vectorstores import VST, VectorStore
|
||||||
@ -29,6 +29,11 @@ if TYPE_CHECKING:
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(
|
||||||
|
since="0.3.3",
|
||||||
|
removal="1.0",
|
||||||
|
alternative_import="langchain_databricks.DatabricksVectorSearch",
|
||||||
|
)
|
||||||
class DatabricksVectorSearch(VectorStore):
|
class DatabricksVectorSearch(VectorStore):
|
||||||
"""`Databricks Vector Search` vector store.
|
"""`Databricks Vector Search` vector store.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user