Databricks Unity Catalog (UC)
This notebook shows how to use UC functions as LangChain tools, with both LangChain and LangGraph agent APIs.
See Databricks documentation (AWS|Azure|GCP) to learn how to create SQL or Python functions in UC. Do not skip function and parameter comments, which are critical for LLMs to call functions properly.
In this example notebook, we create a simple Python function that executes arbitrary code and use it as a LangChain tool:
It runs in a secure and isolated environment within a Databricks SQL warehouse.
(Optional) To increase the retry time for getting a function execution response, set environment variable UC_TOOL_CLIENT_EXECUTION_TIMEOUT. Default retry time value is 120s.