From abc80708c1840f9fa4ac92daa3968602e81d8d97 Mon Sep 17 00:00:00 2001 From: aishwary-dongre <87765118+aishwary-dongre@users.noreply.github.com> Date: Fri, 4 Sep 2026 17:22:50 +0000 Subject: [PATCH] address greptile review: drop restating comments, type test params --- .../bedrock/chat/test_converse_transformation.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py b/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py index 2e566eee0cc..459207f8b88 100644 --- a/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py +++ b/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py @@ -465,19 +465,15 @@ def test_reasoning_effort_none_omits_thinking_for_anthropic_converse(model): @pytest.mark.parametrize( "max_tokens,expect_thinking,expect_budget_below_max_tokens", [ - (1024, False, None), # at/below Bedrock's min thinking budget -> thinking dropped entirely - (2048, True, True), # medium's default budget (2048) equals max_tokens -> must be clamped below it - (4096, True, False), # budget already fits comfortably under max_tokens -> left unchanged + (1024, False, None), + (2048, True, True), + (4096, True, False), ], ) def test_reasoning_effort_thinking_budget_clamped_to_max_tokens_converse( - max_tokens, expect_thinking, expect_budget_below_max_tokens -): - """Regression #39627: a deployment-level reasoning_effort must not send a - thinking.budget_tokens that is >= max_tokens on Bedrock Converse. Bedrock - requires maxTokens strictly greater than thinking.budget_tokens, so the - mapped budget must be clamped the same way the adaptive-downgrade branch - already clamps it, or dropped when even the 1024 minimum can't fit.""" + max_tokens: int, expect_thinking: bool, expect_budget_below_max_tokens: bool | None +) -> None: + """Regression #39627.""" config = AmazonConverseConfig() optional_params = config.map_openai_params(