From 279b4f16cb3c5d783294928f1018bf05320dfb50 Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Tue, 3 Mar 2026 17:57:32 -0300 Subject: [PATCH] Fix mypy override errors in count_tokens signatures Replace **kwargs with explicit tools and system parameters to match the BaseTokenCounter.count_tokens abstract method signature. Co-Authored-By: Claude Opus 4.6 --- litellm/llms/gemini/common_utils.py | 3 ++- litellm/llms/vertex_ai/common_utils.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/llms/gemini/common_utils.py b/litellm/llms/gemini/common_utils.py index f99548c2c4..17b9c78123 100644 --- a/litellm/llms/gemini/common_utils.py +++ b/litellm/llms/gemini/common_utils.py @@ -166,7 +166,8 @@ class GoogleAIStudioTokenCounter(BaseTokenCounter): contents: Optional[List[Dict[str, Any]]], deployment: Optional[Dict[str, Any]] = None, request_model: str = "", - **kwargs, + tools: Optional[List[Dict[str, Any]]] = None, + system: Optional[Any] = None, ) -> Optional[TokenCountResponse]: import copy diff --git a/litellm/llms/vertex_ai/common_utils.py b/litellm/llms/vertex_ai/common_utils.py index 791878c970..3c5cbb6543 100644 --- a/litellm/llms/vertex_ai/common_utils.py +++ b/litellm/llms/vertex_ai/common_utils.py @@ -1030,7 +1030,8 @@ class VertexAITokenCounter(BaseTokenCounter): contents: Optional[List[Dict[str, Any]]], deployment: Optional[Dict[str, Any]] = None, request_model: str = "", - **kwargs, + tools: Optional[List[Dict[str, Any]]] = None, + system: Optional[Any] = None, ) -> Optional[TokenCountResponse]: import copy