From 25d675330cc178cde9a0325b461afa33c824ad05 Mon Sep 17 00:00:00 2001 From: ege-arhan Date: Thu, 22 Oct 2026 15:31:25 +0000 Subject: [PATCH] fix(utils): silence basedpyright noise on allowed_tools guard --- litellm/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index 37f8aecf631..36f3fcd637a 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -9055,7 +9055,10 @@ def validate_chat_completion_tool_choice( # OpenAI also allows constraining which tools the model may call: # {"type": "allowed_tools", "allowed_tools": {"mode": ..., "tools": [...]}}. # Pass it through untouched so downstream providers see the full payload. - if tool_choice_type == "allowed_tools" and isinstance(tool_choice.get("allowed_tools"), dict): + if tool_choice_type == "allowed_tools" and isinstance( + tool_choice.get("allowed_tools"), # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] + dict, + ): return tool_choice # Standard OpenAI format: {"type": "function", "function": {...}}