mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
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 <leonhu@amazon.com>
This commit is contained in:
parent
dc37d1ec67
commit
2d50e37553
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue