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):