mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
feat: Anthropic allow users to set anthropic-beta in headers
This commit is contained in:
parent
176630bce9
commit
32815b06cb
1 changed files with 4 additions and 1 deletions
|
@ -93,6 +93,7 @@ class AnthropicConfig:
|
|||
"max_tokens",
|
||||
"tools",
|
||||
"tool_choice",
|
||||
"extra_headers",
|
||||
]
|
||||
|
||||
def map_openai_params(self, non_default_params: dict, optional_params: dict):
|
||||
|
@ -504,6 +505,8 @@ class AnthropicChatCompletion(BaseLLM):
|
|||
## Handle Tool Calling
|
||||
if "tools" in optional_params:
|
||||
_is_function_call = True
|
||||
if "anthropic-beta" not in headers:
|
||||
# default to v1 of "anthropic-beta"
|
||||
headers["anthropic-beta"] = "tools-2024-04-04"
|
||||
|
||||
anthropic_tools = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue