From 2d50e3755366d16212651f92034b2813b44a3964 Mon Sep 17 00:00:00 2001 From: Leonard Hu Date: Thu, 24 Sep 2026 11:17:42 -0400 Subject: [PATCH] fix(bedrock): drop Final on reassigned local to satisfy type gate final_name is assigned in both branches of the length check, so annotating it Final tripped basedpyright's reportGeneralTypeIssues (cannot reassign a Final) and failed the type-check budget gate. Make it a plain local. Signed-off-by: Leonard Hu --- litellm/litellm_core_utils/prompt_templates/factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py index a11e27d8ed8..03cd377acd7 100644 --- a/litellm/litellm_core_utils/prompt_templates/factory.py +++ b/litellm/litellm_core_utils/prompt_templates/factory.py @@ -4996,7 +4996,7 @@ def make_valid_bedrock_tool_name(input_tool_name: str) -> str: if len(valid_string) > BEDROCK_MAX_TOOL_NAME_LENGTH: name_hash = hashlib.sha256(valid_string.encode()).hexdigest()[:8] prefix_length = BEDROCK_MAX_TOOL_NAME_LENGTH - len(name_hash) - 1 - final_name: Final = f"{valid_string[:prefix_length]}_{name_hash}" + final_name = f"{valid_string[:prefix_length]}_{name_hash}" else: final_name = valid_string