From 54102a660d7c4f87e17a15c7b33e067902117fcd Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 14 Aug 2024 15:18:11 -0700 Subject: [PATCH] pass cache_control in tool call --- litellm/llms/anthropic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/llms/anthropic.py b/litellm/llms/anthropic.py index c9f7856e9be..19fca056bdf 100644 --- a/litellm/llms/anthropic.py +++ b/litellm/llms/anthropic.py @@ -975,6 +975,8 @@ class AnthropicChatCompletion(BaseLLM): else: # assume openai tool call new_tool = tool["function"] new_tool["input_schema"] = new_tool.pop("parameters") # rename key + if "cache_control" in tool: + new_tool["cache_control"] = tool["cache_control"] anthropic_tools.append(new_tool) optional_params["tools"] = anthropic_tools