Skip to content

Commit

Permalink
Deprecating sql_database access for creating UC functions for agent t…
Browse files Browse the repository at this point in the history
…ools
  • Loading branch information
sunishsheth2009 committed Feb 12, 2025
1 parent f4e3e86 commit 8120b8f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 282 deletions.
1 change: 0 additions & 1 deletion cookbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Notebook | Description
[code-analysis-deeplake.ipynb](https://github.com/langchain-ai/langchain/tree/master/cookbook/code-analysis-deeplake.ipynb) | Analyze its own code base with the help of gpt and activeloop's deep lake.
[custom_agent_with_plugin_retri...](https://github.com/langchain-ai/langchain/tree/master/cookbook/custom_agent_with_plugin_retrieval.ipynb) | Build a custom agent that can interact with ai plugins by retrieving tools and creating natural language wrappers around openapi endpoints.
[custom_agent_with_plugin_retri...](https://github.com/langchain-ai/langchain/tree/master/cookbook/custom_agent_with_plugin_retrieval_using_plugnplai.ipynb) | Build a custom agent with plugin retrieval functionality, utilizing ai plugins from the `plugnplai` directory.
[databricks_sql_db.ipynb](https://github.com/langchain-ai/langchain/tree/master/cookbook/databricks_sql_db.ipynb) | Connect to databricks runtimes and databricks sql.
[deeplake_semantic_search_over_...](https://github.com/langchain-ai/langchain/tree/master/cookbook/deeplake_semantic_search_over_chat.ipynb) | Perform semantic search and question-answering over a group chat using activeloop's deep lake with gpt4.
[elasticsearch_db_qa.ipynb](https://github.com/langchain-ai/langchain/tree/master/cookbook/elasticsearch_db_qa.ipynb) | Interact with elasticsearch analytics databases in natural language and build search queries via the elasticsearch dsl API.
[extraction_openai_tools.ipynb](https://github.com/langchain-ai/langchain/tree/master/cookbook/extraction_openai_tools.ipynb) | Structured Data Extraction with OpenAI Tools
Expand Down
273 changes: 0 additions & 273 deletions cookbook/databricks_sql_db.ipynb

This file was deleted.

9 changes: 1 addition & 8 deletions docs/docs/integrations/providers/databricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,7 @@ See [MLflow LangChain Integration](/docs/integrations/providers/mlflow_tracking)

SQLDatabase
-----------
You can connect to Databricks SQL using the SQLDatabase wrapper of LangChain.
```
from langchain.sql_database import SQLDatabase
db = SQLDatabase.from_databricks(catalog="samples", schema="nyctaxi")
```

See [Databricks SQL Agent](https://docs.databricks.com/en/large-language-models/langchain.html#databricks-sql-agent) for how to connect Databricks SQL with your LangChain Agent as a powerful querying tool.
To connect to Databricks SQL or query structured data, see the [Databricks structured retriever tool documentation](https://docs.databricks.com/en/generative-ai/agent-framework/structured-retrieval-tools.html#table-query-tool).

Open Models
-----------
Expand Down
8 changes: 8 additions & 0 deletions libs/community/langchain_community/utilities/sql_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ def from_uri(
return cls(create_engine(database_uri, **_engine_args), **kwargs)

@classmethod
@deprecated(
"0.3.18",
message="For performing structured retrieval using Databricks SQL, "
"see the latest best practices and recommended APIs at "
"https://docs.databricks.com/en/generative-ai/agent-framework/"
"structured-retrieval-tools.html#table-query-tool instead",
removal="1.0",
)
def from_databricks(
cls,
catalog: str,
Expand Down

0 comments on commit 8120b8f

Please sign in to comment.