From 052d8e70ec6045c225581dbce4ed60584c132c33 Mon Sep 17 00:00:00 2001 From: Charles Cheng Date: Sat, 20 Jun 2026 10:28:34 +0800 Subject: [PATCH] fix(anthropic): define ANTHROPIC_NON_CACHEABLE_TOOL_TYPES in constants Refactor commit df59746 imported the constant from litellm.constants but omitted the definition, breaking the top-level 'from litellm import *' with an ImportError. Add the tuple there so the import resolves. --- litellm/constants.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/litellm/constants.py b/litellm/constants.py index c0e265c0e4a..d16e55a4b42 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -530,6 +530,13 @@ ANTHROPIC_WEB_SEARCH_TOOL_MAX_USES = { "high": 10, } +# Tool types Anthropic rejects cache_control on. +# Referenced by anthropic_cache_control_hook and transformation.py. +ANTHROPIC_NON_CACHEABLE_TOOL_TYPES: tuple = ( + "tool_search_tool_regex_20251119", + "tool_search_tool_bm25_20251119", +) + # LiteLLM standard web search tool name # Used for web search interception across providers LITELLM_WEB_SEARCH_TOOL_NAME = "litellm_web_search"