diff --git a/integrations/langchain/pyproject.toml b/integrations/langchain/pyproject.toml index 28d4422..ec54ce4 100644 --- a/integrations/langchain/pyproject.toml +++ b/integrations/langchain/pyproject.toml @@ -11,7 +11,6 @@ requires-python = ">=3.9" dependencies = [ "langchain>=0.2.0", "langchain-community>=0.2.0", - "langchain-databricks>=0.1.1", "databricks-ai-bridge", ] diff --git a/integrations/langchain/src/databricks_langchain/__init__.py b/integrations/langchain/src/databricks_langchain/__init__.py index 1cf2d82..b457f47 100644 --- a/integrations/langchain/src/databricks_langchain/__init__.py +++ b/integrations/langchain/src/databricks_langchain/__init__.py @@ -1,4 +1,3 @@ -# Import modules from langchain-databricks from databricks_langchain.chat_models import ChatDatabricks from databricks_langchain.embeddings import DatabricksEmbeddings from databricks_langchain.genie import GenieAgent diff --git a/integrations/langchain/src/databricks_langchain/chat_models.py b/integrations/langchain/src/databricks_langchain/chat_models.py index 8aa1bd1..490aa11 100644 --- a/integrations/langchain/src/databricks_langchain/chat_models.py +++ b/integrations/langchain/src/databricks_langchain/chat_models.py @@ -50,7 +50,7 @@ from langchain_core.tools import BaseTool from langchain_core.utils.function_calling import convert_to_openai_tool from langchain_core.utils.pydantic import is_basemodel_subclass -from langchain_databricks.utils import get_deployment_client +from databricks_langchain.utils import get_deployment_client from mlflow.deployments import BaseDeploymentClient # type: ignore from pydantic import BaseModel, Field @@ -61,11 +61,11 @@ class ChatDatabricks(BaseChatModel): """Databricks chat model integration. Setup: - Install ``langchain-databricks``. + Install ``databricks-langchain``. .. code-block:: bash - pip install -U langchain-databricks + pip install -U databricks-langchain If you are outside Databricks, set the Databricks workspace hostname and personal access token to environment variables: @@ -93,7 +93,7 @@ class ChatDatabricks(BaseChatModel): Instantiate: .. code-block:: python - from langchain_databricks import ChatDatabricks + from databricks_langchain import ChatDatabricks llm = ChatDatabricks( endpoint="databricks-meta-llama-3-1-405b-instruct", @@ -481,7 +481,7 @@ def with_structured_output( Example: Function-calling, Pydantic schema (method="function_calling", include_raw=False): .. code-block:: python - from langchain_databricks import ChatDatabricks + from databricks_langchain import ChatDatabricks from pydantic import BaseModel @@ -505,7 +505,7 @@ class AnswerWithJustification(BaseModel): Example: Function-calling, Pydantic schema (method="function_calling", include_raw=True): .. code-block:: python - from langchain_databricks import ChatDatabricks + from databricks_langchain import ChatDatabricks from pydantic import BaseModel @@ -529,7 +529,7 @@ class AnswerWithJustification(BaseModel): Example: Function-calling, dict schema (method="function_calling", include_raw=False): .. code-block:: python - from langchain_databricks import ChatDatabricks + from databricks_langchain import ChatDatabricks from langchain_core.utils.function_calling import convert_to_openai_tool from pydantic import BaseModel @@ -554,7 +554,7 @@ class AnswerWithJustification(BaseModel): Example: JSON mode, Pydantic schema (method="json_mode", include_raw=True): .. code-block:: - from langchain_databricks import ChatDatabricks + from databricks_langchain import ChatDatabricks from pydantic import BaseModel class AnswerWithJustification(BaseModel): diff --git a/integrations/langchain/src/databricks_langchain/embeddings.py b/integrations/langchain/src/databricks_langchain/embeddings.py index 4165e8f..49e04fd 100644 --- a/integrations/langchain/src/databricks_langchain/embeddings.py +++ b/integrations/langchain/src/databricks_langchain/embeddings.py @@ -1,7 +1,7 @@ from typing import Any, Dict, Iterator, List from langchain_core.embeddings import Embeddings -from langchain_databricks.utils import get_deployment_client +from databricks_langchain.utils import get_deployment_client from pydantic import BaseModel, PrivateAttr @@ -9,11 +9,11 @@ class DatabricksEmbeddings(Embeddings, BaseModel): """Databricks embedding model integration. Setup: - Install ``langchain-databricks``. + Install ``databricks-langchain``. .. code-block:: bash - pip install -U langchain-databricks + pip install -U databricks-langchain If you are outside Databricks, set the Databricks workspace hostname and personal access token to environment variables: @@ -35,7 +35,7 @@ class DatabricksEmbeddings(Embeddings, BaseModel): Instantiate: .. code-block:: python - from langchain_databricks import DatabricksEmbeddings + from databricks_langchain import DatabricksEmbeddings embed = DatabricksEmbeddings( endpoint="databricks-bge-large-en", diff --git a/integrations/langchain/src/databricks_langchain/vectorstores.py b/integrations/langchain/src/databricks_langchain/vectorstores.py index 71b2f81..0e7372b 100644 --- a/integrations/langchain/src/databricks_langchain/vectorstores.py +++ b/integrations/langchain/src/databricks_langchain/vectorstores.py @@ -22,7 +22,7 @@ from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstores import VST, VectorStore -from langchain_databricks.utils import maximal_marginal_relevance +from databricks_langchain.utils import maximal_marginal_relevance logger = logging.getLogger(__name__) @@ -41,11 +41,11 @@ class DatabricksVectorSearch(VectorStore): """Databricks vector store integration. Setup: - Install ``langchain-databricks`` and ``databricks-vectorsearch`` python packages. + Install ``databricks-langchain`` and ``databricks-vectorsearch`` python packages. .. code-block:: bash - pip install -U langchain-databricks databricks-vectorsearch + pip install -U databricks-langchain databricks-vectorsearch If you don't have a Databricks Vector Search endpoint already, you can create one by following the instructions here: https://docs.databricks.com/en/generative-ai/create-query-vector-search.html @@ -100,7 +100,7 @@ class DatabricksVectorSearch(VectorStore): .. code-block:: python - from langchain_databricks.vectorstores import DatabricksVectorSearch + from databricks_langchain.vectorstores import DatabricksVectorSearch vector_store = DatabricksVectorSearch(index_name="")