Skip to content

Commit

Permalink
Merge branch 'main' into langchain-vs-tool
Browse files Browse the repository at this point in the history
  • Loading branch information
leonbi100 committed Dec 18, 2024
2 parents 60a5eb5 + efb256a commit fe09b25
Show file tree
Hide file tree
Showing 16 changed files with 755 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ jobs:
pip install integrations/langchain[dev]
- name: Run tests
run: |
pytest integrations/langchain/tests
pytest integrations/langchain/tests/unit_tests
44 changes: 30 additions & 14 deletions integrations/langchain/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,54 @@
# 🦜🔗 Using Databricks AI Bridge with Langchain
# 🦜🔗 Databricks LangChain Integration

Integrate Databricks AI Bridge package with Langchain to allow seamless usage of Databricks AI features with Langchain/Langgraph applications.

Note: This repository is the future home for all Databricks integrations currently found in `langchain-databricks` and `langchain-community`. We have now aliased `langchain-databricks` to `databricks-langchain`, consolidating integrations such as ChatDatabricks, DatabricksEmbeddings, DatabricksVectorSearch, and more under this package.
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`.

## Installation

### Install from PyPI
### From PyPI
```sh
pip install databricks-langchain
```

### Install from source

### From Source
```sh
pip install git+ssh://[email protected]/databricks/databricks-ai-bridge.git#subdirectory=integrations/langchain
```

## Get started
## Key Features

### Use LLMs on Databricks
- **LLMs Integration:** Use Databricks-hosted large language models (LLMs) like Llama and Mixtral through `ChatDatabricks`.
- **Vector Search:** Store and query vector representations using `DatabricksVectorSearch`.
- **Embeddings:** Generate embeddings with `DatabricksEmbeddings`.
- **Genie:** Use [Genie](https://www.databricks.com/product/ai-bi/genie) in Langchain.

## Getting Started

### Use LLMs on Databricks
```python
from databricks_langchain import ChatDatabricks

llm = ChatDatabricks(endpoint="databricks-meta-llama-3-1-70b-instruct")
```

### (Preview) Use a Genie space as an agent

> [!NOTE]
> Requires Genie API Private Preview. Reach out to your account team for enablement.
### Use a Genie Space as an Agent (Preview)
> **Note:** Requires Genie API Private Preview. Contact your Databricks account team for enablement.
```python
from databricks_langchain.genie import GenieAgent

genie_agent = GenieAgent("space-id", "Genie", description="This Genie space has access to sales data in Europe")
genie_agent = GenieAgent(
"space-id", "Genie",
description="This Genie space has access to sales data in Europe"
)
```

---

## Contribution Guide
We welcome contributions! Please see our [contribution guidelines](https://github.com/databricks/databricks-ai-bridge/tree/main/integrations/langchain) for details.

## License
This project is licensed under the [MIT License](LICENSE).

Thank you for using Databricks LangChain!

5 changes: 5 additions & 0 deletions integrations/langchain/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ dev = [
"ruff==0.6.4",
]

integration = [
"langgraph>=0.2.27",
"pytest-timeout>=2.3.1",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Expand Down
Empty file.
Loading

0 comments on commit fe09b25

Please sign in to comment.