From a6a98cbfbe3e83b1aef0d98415d7bcda6c3528bb Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Wed, 24 Jun 2026 14:19:54 +0530 Subject: [PATCH] fix(lint): use builtin list[] instead of List[] for UP006 compliance --- litellm/llms/anthropic/common_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/anthropic/common_utils.py b/litellm/llms/anthropic/common_utils.py index b2e8e9cd661..6fdd8d868a1 100644 --- a/litellm/llms/anthropic/common_utils.py +++ b/litellm/llms/anthropic/common_utils.py @@ -1029,7 +1029,7 @@ def _sanitize_tool_use_id_content_block(block: Any) -> Any: return block -def sanitize_tool_use_ids_in_anthropic_messages(messages: List[Any]) -> List[Any]: +def sanitize_tool_use_ids_in_anthropic_messages(messages: list[Any]) -> list[Any]: """ Return a new message list with ``tool_use`` / ``server_tool_use`` ``id`` and ``tool_result`` ``tool_use_id`` values rewritten to satisfy Anthropic's @@ -1040,7 +1040,7 @@ def sanitize_tool_use_ids_in_anthropic_messages(messages: List[Any]) -> List[Any and ``:`` — valid on the upstream provider but rejected by Anthropic when the session is switched to a native Anthropic deployment. """ - out: List[Any] = [] + out: list[Any] = [] for m in messages: if not isinstance(m, dict) or not isinstance(m.get("content"), list): out.append(m)