From 24e8619db5ea4ad426389a8ffcb6d0d46d3e50bf Mon Sep 17 00:00:00 2001 From: vovanphuc Date: Thu, 20 Aug 2026 09:30:16 +0700 Subject: [PATCH] fix(google_genai): annotate FunctionDeclaration.parameters as a read-only Mapping The new TypedDict field tripped the LIT001 type-discipline budget by adding one more mutable collection annotation. Declare it as Mapping[str, object] instead, which is the read-only view the rule asks for, leaving the budget at its base total. --- litellm/google_genai/adapters/transformation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/google_genai/adapters/transformation.py b/litellm/google_genai/adapters/transformation.py index 15cbcf02bfc..90303f0cf6a 100644 --- a/litellm/google_genai/adapters/transformation.py +++ b/litellm/google_genai/adapters/transformation.py @@ -1,5 +1,5 @@ import json -from collections.abc import AsyncIterator, Iterator, Sequence +from collections.abc import AsyncIterator, Iterator, Mapping, Sequence from typing import Any, Final, TypedDict, cast from typing_extensions import ReadOnly @@ -47,7 +47,7 @@ class _GenAIPart(TypedDict, total=False): class _GenAIFunctionDeclaration(TypedDict, total=False): name: ReadOnly[str] description: ReadOnly[str] - parameters: ReadOnly[dict[str, object]] + parameters: ReadOnly[Mapping[str, object]] parametersJsonSchema: ReadOnly[dict[str, object]]