mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
test fixes
This commit is contained in:
parent
ccd3e6cbba
commit
60a0a82c2d
3 changed files with 16 additions and 10 deletions
|
|
@ -134,7 +134,8 @@ class AmazonAnthropicClaudeConfig(AmazonInvokeConfig, AnthropicConfig):
|
|||
programmatic_tool_calling_used = self.is_programmatic_tool_calling_used(tools)
|
||||
input_examples_used = self.is_input_examples_used(tools)
|
||||
|
||||
beta_set = set(get_anthropic_beta_from_headers(headers))
|
||||
user_beta_set = set(get_anthropic_beta_from_headers(headers))
|
||||
beta_set = set(user_beta_set)
|
||||
auto_betas = self.get_anthropic_beta_list(
|
||||
model=model,
|
||||
optional_params=optional_params,
|
||||
|
|
@ -154,10 +155,11 @@ class AmazonAnthropicClaudeConfig(AmazonInvokeConfig, AnthropicConfig):
|
|||
|
||||
# Filter out beta headers that Bedrock Invoke doesn't support
|
||||
# Uses centralized configuration from anthropic_beta_headers_config.json
|
||||
beta_list = filter_and_transform_beta_headers(
|
||||
beta_headers=list(beta_set),
|
||||
auto_beta_list = filter_and_transform_beta_headers(
|
||||
beta_headers=list(beta_set - user_beta_set),
|
||||
provider="bedrock",
|
||||
)
|
||||
beta_list = sorted(user_beta_set.union(set(auto_beta_list)))
|
||||
if beta_list:
|
||||
_anthropic_request["anthropic_beta"] = beta_list
|
||||
|
||||
|
|
@ -204,7 +206,8 @@ class AmazonAnthropicClaudeConfig(AmazonInvokeConfig, AnthropicConfig):
|
|||
programmatic_tool_calling_used = self.is_programmatic_tool_calling_used(tools)
|
||||
input_examples_used = self.is_input_examples_used(tools)
|
||||
|
||||
beta_set = set(get_anthropic_beta_from_headers(headers))
|
||||
user_beta_set = set(get_anthropic_beta_from_headers(headers))
|
||||
beta_set = set(user_beta_set)
|
||||
auto_betas = self.get_anthropic_beta_list(
|
||||
model=model,
|
||||
optional_params=optional_params,
|
||||
|
|
@ -222,10 +225,11 @@ class AmazonAnthropicClaudeConfig(AmazonInvokeConfig, AnthropicConfig):
|
|||
if "opus-4" in model.lower() or "opus_4" in model.lower():
|
||||
beta_set.add("tool-search-tool-2025-10-19")
|
||||
|
||||
beta_list = filter_and_transform_beta_headers(
|
||||
beta_headers=list(beta_set),
|
||||
auto_beta_list = filter_and_transform_beta_headers(
|
||||
beta_headers=list(beta_set - user_beta_set),
|
||||
provider="bedrock",
|
||||
)
|
||||
beta_list = sorted(user_beta_set.union(set(auto_beta_list)))
|
||||
if beta_list:
|
||||
_anthropic_request["anthropic_beta"] = beta_list
|
||||
|
||||
|
|
|
|||
|
|
@ -437,7 +437,8 @@ class AmazonAnthropicClaudeMessagesConfig(
|
|||
)
|
||||
input_examples_used = anthropic_model_info.is_input_examples_used(tools)
|
||||
|
||||
beta_set = set(get_anthropic_beta_from_headers(headers))
|
||||
user_beta_set = set(get_anthropic_beta_from_headers(headers))
|
||||
beta_set = set(user_beta_set)
|
||||
auto_betas = anthropic_model_info.get_anthropic_beta_list(
|
||||
model=model,
|
||||
optional_params=anthropic_messages_optional_request_params,
|
||||
|
|
@ -461,10 +462,11 @@ class AmazonAnthropicClaudeMessagesConfig(
|
|||
if "tool-search-tool-2025-10-19" in beta_set:
|
||||
beta_set.add("tool-examples-2025-10-29")
|
||||
|
||||
filtered_betas = filter_and_transform_beta_headers(
|
||||
beta_headers=list(beta_set),
|
||||
filtered_auto_betas = filter_and_transform_beta_headers(
|
||||
beta_headers=list(beta_set - user_beta_set),
|
||||
provider="bedrock",
|
||||
)
|
||||
filtered_betas = sorted(user_beta_set.union(set(filtered_auto_betas)))
|
||||
if filtered_betas:
|
||||
anthropic_messages_request["anthropic_beta"] = filtered_betas
|
||||
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ class BaseLLMChatTest(ABC):
|
|||
{
|
||||
"type": "file",
|
||||
"file": {
|
||||
"file_id": "https://raw.githubusercontent.com/BerriAI/litellm/main/tests/llm_translation/fixtures/dummy.pdf"
|
||||
"file_id": "https://upload.wikimedia.org/wikipedia/commons/2/20/Re_example.pdf"
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue