Skip to main content
本 notebook 展示如何使用 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. 在此示例中 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.

LangGraph agent example

LangGraph agent example

LangChain agent example