databricks-langchain 0.13.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- databricks_langchain-0.13.0/.gitignore +22 -0
- databricks_langchain-0.13.0/PKG-INFO +76 -0
- databricks_langchain-0.13.0/README.md +54 -0
- databricks_langchain-0.13.0/pyproject.toml +78 -0
- databricks_langchain-0.13.0/src/databricks_langchain/__init__.py +51 -0
- databricks_langchain-0.13.0/src/databricks_langchain/chat_models.py +1448 -0
- databricks_langchain-0.13.0/src/databricks_langchain/checkpoint.py +92 -0
- databricks_langchain-0.13.0/src/databricks_langchain/embeddings.py +69 -0
- databricks_langchain-0.13.0/src/databricks_langchain/genie.py +175 -0
- databricks_langchain-0.13.0/src/databricks_langchain/multi_server_mcp_client.py +368 -0
- databricks_langchain-0.13.0/src/databricks_langchain/store.py +253 -0
- databricks_langchain-0.13.0/src/databricks_langchain/uc_ai/__init__.py +21 -0
- databricks_langchain-0.13.0/src/databricks_langchain/utils.py +126 -0
- databricks_langchain-0.13.0/src/databricks_langchain/vector_search_retriever_tool.py +115 -0
- databricks_langchain-0.13.0/src/databricks_langchain/vectorstores.py +827 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: databricks-langchain
|
|
3
|
+
Version: 0.13.0
|
|
4
|
+
Summary: Support for Databricks AI support in LangChain
|
|
5
|
+
Author-email: Databricks <agent-feedback@databricks.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Requires-Dist: databricks-ai-bridge>=0.4.2
|
|
9
|
+
Requires-Dist: databricks-mcp>=0.5.1
|
|
10
|
+
Requires-Dist: databricks-sdk>=0.65.0
|
|
11
|
+
Requires-Dist: databricks-vectorsearch>=0.50
|
|
12
|
+
Requires-Dist: langchain-mcp-adapters>=0.1.13
|
|
13
|
+
Requires-Dist: langchain>=1.0.0
|
|
14
|
+
Requires-Dist: mlflow>=3.0.0
|
|
15
|
+
Requires-Dist: openai>=1.99.9
|
|
16
|
+
Requires-Dist: pydantic>2.10.0
|
|
17
|
+
Requires-Dist: unitycatalog-langchain[databricks]>=0.3.0
|
|
18
|
+
Provides-Extra: memory
|
|
19
|
+
Requires-Dist: databricks-ai-bridge[memory]>=0.10.0; extra == 'memory'
|
|
20
|
+
Requires-Dist: langgraph-checkpoint-postgres>=2.0.5; extra == 'memory'
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# 🦜🔗 Databricks LangChain Integration
|
|
24
|
+
|
|
25
|
+
The `databricks-langchain` package provides seamless integration of Databricks AI features into LangChain applications. This repository is now the central hub for all Databricks-related LangChain components, consolidating previous packages such as `langchain-databricks` and `langchain-community`.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### From PyPI
|
|
30
|
+
```sh
|
|
31
|
+
pip install databricks-langchain
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### From Source
|
|
35
|
+
```sh
|
|
36
|
+
pip install git+https://git@github.com/databricks/databricks-ai-bridge.git#subdirectory=integrations/langchain
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Key Features
|
|
40
|
+
|
|
41
|
+
- **LLMs Integration:** Use Databricks-hosted large language models (LLMs) like Llama and Mixtral through `ChatDatabricks`.
|
|
42
|
+
- **Vector Search:** Store and query vector representations using `DatabricksVectorSearch`.
|
|
43
|
+
- **Embeddings:** Generate embeddings with `DatabricksEmbeddings`.
|
|
44
|
+
- **Genie:** Use [Genie](https://www.databricks.com/product/ai-bi/genie) in Langchain.
|
|
45
|
+
|
|
46
|
+
## Getting Started
|
|
47
|
+
|
|
48
|
+
### Use LLMs on Databricks
|
|
49
|
+
```python
|
|
50
|
+
from databricks_langchain import ChatDatabricks
|
|
51
|
+
|
|
52
|
+
llm = ChatDatabricks(endpoint="databricks-meta-llama-3-1-70b-instruct")
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Use a Genie Space as an Agent (Preview)
|
|
56
|
+
> **Note:** Requires Genie API Private Preview. Contact your Databricks account team for enablement.
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from databricks_langchain.genie import GenieAgent
|
|
60
|
+
|
|
61
|
+
genie_agent = GenieAgent(
|
|
62
|
+
"space-id", "Genie",
|
|
63
|
+
description="This Genie space has access to sales data in Europe"
|
|
64
|
+
)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Contribution Guide
|
|
70
|
+
We welcome contributions! Please see our [contribution guidelines](https://github.com/databricks/databricks-ai-bridge/tree/main/integrations/langchain) for details.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
74
|
+
|
|
75
|
+
Thank you for using Databricks LangChain!
|
|
76
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# 🦜🔗 Databricks LangChain Integration
|
|
2
|
+
|
|
3
|
+
The `databricks-langchain` package provides seamless integration of Databricks AI features into LangChain applications. This repository is now the central hub for all Databricks-related LangChain components, consolidating previous packages such as `langchain-databricks` and `langchain-community`.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### From PyPI
|
|
8
|
+
```sh
|
|
9
|
+
pip install databricks-langchain
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### From Source
|
|
13
|
+
```sh
|
|
14
|
+
pip install git+https://git@github.com/databricks/databricks-ai-bridge.git#subdirectory=integrations/langchain
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Key Features
|
|
18
|
+
|
|
19
|
+
- **LLMs Integration:** Use Databricks-hosted large language models (LLMs) like Llama and Mixtral through `ChatDatabricks`.
|
|
20
|
+
- **Vector Search:** Store and query vector representations using `DatabricksVectorSearch`.
|
|
21
|
+
- **Embeddings:** Generate embeddings with `DatabricksEmbeddings`.
|
|
22
|
+
- **Genie:** Use [Genie](https://www.databricks.com/product/ai-bi/genie) in Langchain.
|
|
23
|
+
|
|
24
|
+
## Getting Started
|
|
25
|
+
|
|
26
|
+
### Use LLMs on Databricks
|
|
27
|
+
```python
|
|
28
|
+
from databricks_langchain import ChatDatabricks
|
|
29
|
+
|
|
30
|
+
llm = ChatDatabricks(endpoint="databricks-meta-llama-3-1-70b-instruct")
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Use a Genie Space as an Agent (Preview)
|
|
34
|
+
> **Note:** Requires Genie API Private Preview. Contact your Databricks account team for enablement.
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from databricks_langchain.genie import GenieAgent
|
|
38
|
+
|
|
39
|
+
genie_agent = GenieAgent(
|
|
40
|
+
"space-id", "Genie",
|
|
41
|
+
description="This Genie space has access to sales data in Europe"
|
|
42
|
+
)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Contribution Guide
|
|
48
|
+
We welcome contributions! Please see our [contribution guidelines](https://github.com/databricks/databricks-ai-bridge/tree/main/integrations/langchain) for details.
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
52
|
+
|
|
53
|
+
Thank you for using Databricks LangChain!
|
|
54
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "databricks-langchain"
|
|
3
|
+
version = "0.13.0"
|
|
4
|
+
description = "Support for Databricks AI support in LangChain"
|
|
5
|
+
authors = [
|
|
6
|
+
{ name="Databricks", email="agent-feedback@databricks.com" },
|
|
7
|
+
]
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
license = { text="Apache-2.0" }
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"langchain>=1.0.0",
|
|
13
|
+
"databricks-vectorsearch>=0.50",
|
|
14
|
+
"databricks-ai-bridge>=0.4.2",
|
|
15
|
+
"mlflow>=3.0.0",
|
|
16
|
+
"pydantic>2.10.0",
|
|
17
|
+
"unitycatalog-langchain[databricks]>=0.3.0",
|
|
18
|
+
"databricks-sdk>=0.65.0",
|
|
19
|
+
"openai>=1.99.9",
|
|
20
|
+
"langchain-mcp-adapters>=0.1.13",
|
|
21
|
+
"databricks_mcp>=0.5.1",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
memory = [
|
|
26
|
+
"langgraph-checkpoint-postgres>=2.0.5",
|
|
27
|
+
"databricks-ai-bridge[memory]>=0.10.0",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[dependency-groups]
|
|
31
|
+
dev = [
|
|
32
|
+
"typing_extensions>=4.15.0",
|
|
33
|
+
"ruff==0.14.10",
|
|
34
|
+
"ty>=0.0.11",
|
|
35
|
+
{ include-group = "tests" },
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
tests = [
|
|
39
|
+
"pytest>=9.0.0",
|
|
40
|
+
"langgraph>=0.2.27",
|
|
41
|
+
"pytest-timeout>=2.3.1",
|
|
42
|
+
"pytest-asyncio>=1.3.0",
|
|
43
|
+
"anyio>=4.8.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
[build-system]
|
|
48
|
+
requires = ["hatchling"]
|
|
49
|
+
build-backend = "hatchling.build"
|
|
50
|
+
|
|
51
|
+
[tool.uv.sources]
|
|
52
|
+
databricks-ai-bridge = { path = "../../", editable = true }
|
|
53
|
+
|
|
54
|
+
[tool.hatch.build]
|
|
55
|
+
include = [
|
|
56
|
+
"src/databricks_langchain/*"
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[tool.hatch.build.targets.wheel]
|
|
60
|
+
packages = ["src/databricks_langchain"]
|
|
61
|
+
|
|
62
|
+
[tool.ruff]
|
|
63
|
+
include = ["pyproject.toml", "src/**/*.py", "tests/**/*.py"]
|
|
64
|
+
extend = "../../pyproject.toml"
|
|
65
|
+
|
|
66
|
+
[tool.pytest.ini_options]
|
|
67
|
+
filterwarnings = [
|
|
68
|
+
"ignore::Warning",
|
|
69
|
+
"default::Warning:databricks_langchain",
|
|
70
|
+
"default::Warning:tests",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[tool.ty.environment]
|
|
74
|
+
root = ["./src", "./tests"]
|
|
75
|
+
|
|
76
|
+
[tool.ty.src]
|
|
77
|
+
include = ["./src", "./tests"]
|
|
78
|
+
exclude = ["./tests/integration_tests"]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""
|
|
2
|
+
**Re-exported Unity Catalog Utilities**
|
|
3
|
+
|
|
4
|
+
This module re-exports selected utilities from the Unity Catalog open source package.
|
|
5
|
+
|
|
6
|
+
Available aliases:
|
|
7
|
+
|
|
8
|
+
- :class:`databricks_langchain.UCFunctionToolkit`
|
|
9
|
+
- :class:`databricks_langchain.UnityCatalogTool`
|
|
10
|
+
- :class:`databricks_langchain.DatabricksFunctionClient`
|
|
11
|
+
- :func:`databricks_langchain.set_uc_function_client`
|
|
12
|
+
|
|
13
|
+
Refer to the Unity Catalog `documentation <https://docs.unitycatalog.io/ai/integrations/langchain/#using-unity-catalog-ai-with-langchain>`_ for more information.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from unitycatalog.ai.core.base import set_uc_function_client
|
|
17
|
+
from unitycatalog.ai.core.databricks import DatabricksFunctionClient
|
|
18
|
+
from unitycatalog.ai.langchain.toolkit import UCFunctionToolkit, UnityCatalogTool
|
|
19
|
+
|
|
20
|
+
from databricks_langchain.chat_models import ChatDatabricks
|
|
21
|
+
from databricks_langchain.checkpoint import AsyncCheckpointSaver, CheckpointSaver
|
|
22
|
+
from databricks_langchain.embeddings import DatabricksEmbeddings
|
|
23
|
+
from databricks_langchain.genie import GenieAgent
|
|
24
|
+
from databricks_langchain.multi_server_mcp_client import (
|
|
25
|
+
DatabricksMCPServer,
|
|
26
|
+
DatabricksMultiServerMCPClient,
|
|
27
|
+
MCPServer,
|
|
28
|
+
)
|
|
29
|
+
from databricks_langchain.store import AsyncDatabricksStore, DatabricksStore
|
|
30
|
+
from databricks_langchain.vector_search_retriever_tool import VectorSearchRetrieverTool
|
|
31
|
+
from databricks_langchain.vectorstores import DatabricksVectorSearch
|
|
32
|
+
|
|
33
|
+
# Expose all integrations to users under databricks-langchain
|
|
34
|
+
__all__ = [
|
|
35
|
+
"AsyncCheckpointSaver",
|
|
36
|
+
"AsyncDatabricksStore",
|
|
37
|
+
"ChatDatabricks",
|
|
38
|
+
"CheckpointSaver",
|
|
39
|
+
"DatabricksEmbeddings",
|
|
40
|
+
"DatabricksStore",
|
|
41
|
+
"DatabricksVectorSearch",
|
|
42
|
+
"GenieAgent",
|
|
43
|
+
"VectorSearchRetrieverTool",
|
|
44
|
+
"UCFunctionToolkit",
|
|
45
|
+
"UnityCatalogTool",
|
|
46
|
+
"DatabricksFunctionClient",
|
|
47
|
+
"set_uc_function_client",
|
|
48
|
+
"DatabricksMultiServerMCPClient",
|
|
49
|
+
"DatabricksMCPServer",
|
|
50
|
+
"MCPServer",
|
|
51
|
+
]
|