From 5fb64c337d4ee1d8ba02d9147020939695ec336a Mon Sep 17 00:00:00 2001 From: frank Date: Sun, 5 Apr 2026 21:39:58 +0800 Subject: [PATCH] 25070,provide the databricks tool prompt cache Signed-off-by: frank --- litellm/llms/databricks/chat/transformation.py | 7 ++++--- litellm/types/llms/databricks.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/litellm/llms/databricks/chat/transformation.py b/litellm/llms/databricks/chat/transformation.py index a8790bc1866..33aabf16974 100644 --- a/litellm/llms/databricks/chat/transformation.py +++ b/litellm/llms/databricks/chat/transformation.py @@ -231,9 +231,10 @@ class DatabricksConfig(DatabricksBase, OpenAILikeChatConfig, AnthropicConfig): type="function", function=function_params, ) - - if tool.get("cache_control"): - databricks_tool["cache_control"] = cast(dict, tool.get("cache_control")) + + cache_control = tool.get("cache_control") + if cache_control: + databricks_tool["cache_control"] = cast(dict, cache_control) return databricks_tool diff --git a/litellm/types/llms/databricks.py b/litellm/types/llms/databricks.py index dcf35be7e63..14449d4f692 100644 --- a/litellm/types/llms/databricks.py +++ b/litellm/types/llms/databricks.py @@ -60,7 +60,7 @@ class DatabricksFunction(TypedDict, total=False): class DatabricksTool(TypedDict, total=False): function: DatabricksFunction type: Literal["function"] - cache_control: Optional[dict] + cache_control: Required[dict] class DatabricksMessage(TypedDict, total=False):