pass cache_control in tool call

This commit is contained in:
Ishaan Jaff 2024-08-14 15:18:11 -07:00
parent 96f9655a02
commit 54102a660d

View file

@ -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