From 32a04c59cfd2ca8bf0f88ea96f5501d9d09c7b36 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 17 May 2024 00:40:55 -0700 Subject: [PATCH] fix(anthropic.py): bump default anthropic api version for tool use --- docs/my-website/docs/providers/anthropic.md | 2 -- litellm/llms/anthropic.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/my-website/docs/providers/anthropic.md b/docs/my-website/docs/providers/anthropic.md index bf8f72bea1..38be0c433a 100644 --- a/docs/my-website/docs/providers/anthropic.md +++ b/docs/my-website/docs/providers/anthropic.md @@ -232,7 +232,6 @@ response = completion( model="anthropic/claude-3-opus-20240229", messages=messages, tools=tools, - extra_headers={"anthropic-beta": "tools-2024-05-16"}, ) ``` @@ -247,7 +246,6 @@ response = completion( messages=messages, tools=tools, tool_choice={"type": "tool", "name": "get_weather"}, - extra_headers={"anthropic-beta": "tools-2024-05-16"}, ) ``` diff --git a/litellm/llms/anthropic.py b/litellm/llms/anthropic.py index 2e02ffe59f..f14dabc03a 100644 --- a/litellm/llms/anthropic.py +++ b/litellm/llms/anthropic.py @@ -507,7 +507,7 @@ class AnthropicChatCompletion(BaseLLM): _is_function_call = True if "anthropic-beta" not in headers: # default to v1 of "anthropic-beta" - headers["anthropic-beta"] = "tools-2024-04-04" + headers["anthropic-beta"] = "tools-2024-05-16" anthropic_tools = [] for tool in optional_params["tools"]: