From ba77ca902b2baaa9b313b4323c84ec506b533b32 Mon Sep 17 00:00:00 2001 From: Li-john1021 <215793081+Li-john1021@users.noreply.github.com> Date: Thu, 15 Oct 2026 12:58:19 +0800 Subject: [PATCH] style: shrink transformation helper to clear LIT001 ceiling --- .../llms/anthropic/pass_through/adapters/transformation.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/litellm/llms/anthropic/pass_through/adapters/transformation.py b/litellm/llms/anthropic/pass_through/adapters/transformation.py index ccdd92cc493..9340f9741d9 100644 --- a/litellm/llms/anthropic/pass_through/adapters/transformation.py +++ b/litellm/llms/anthropic/pass_through/adapters/transformation.py @@ -349,9 +349,7 @@ class AnthropicAdapter: def _base_tool_use_id(raw_id: object) -> str: """Strip an embedded thought signature from a tool_use / tool_result id.""" - if isinstance(raw_id, str): - return split_anthropic_tool_use_id_signature(raw_id)[0] - return "" + return split_anthropic_tool_use_id_signature(raw_id)[0] if isinstance(raw_id, str) else "" _BlockT: Final = TypeVar("_BlockT", bound=Mapping[str, object])