From 029d10098301619c2f8a919d261271dc485745ec Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 13 Aug 2026 16:24:41 +0000 Subject: [PATCH] fix(lint): pull LIT012 count back under the type-discipline ceiling Recent adds to UsagePerChunk (inference_geo, speed) and NvidiaNimPassageObject (image) pushed the LIT012 total to 4522, three over the 4519 ceiling in type-discipline-budget.json. The push-triggered lint job on litellm_internal_staging started failing because the gate compares against an older base that predates all three additions. Qualify the two new UsagePerChunk fields with ReadOnly since they are only ever set at construction and read afterward. Suppress the new NvidiaNimPassageObject image field with # writable-ok because the transform_rerank_request builder assigns fields on the returned TypedDict after constructing it. Co-authored-by: Krrish Dholakia --- litellm/llms/nvidia_nim/rerank/transformation.py | 2 +- .../litellm_core_utils/streaming_chunk_builder_utils.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/llms/nvidia_nim/rerank/transformation.py b/litellm/llms/nvidia_nim/rerank/transformation.py index bb07f9ec74f..4f68099682b 100644 --- a/litellm/llms/nvidia_nim/rerank/transformation.py +++ b/litellm/llms/nvidia_nim/rerank/transformation.py @@ -23,7 +23,7 @@ class NvidiaNimQueryObject(TypedDict): class NvidiaNimPassageObject(TypedDict, total=False): text: str - image: str + image: str # writable-ok: assembled field-by-field in transform_rerank_request class NvidiaNimRerankRequest(TypedDict, total=False): diff --git a/litellm/types/litellm_core_utils/streaming_chunk_builder_utils.py b/litellm/types/litellm_core_utils/streaming_chunk_builder_utils.py index 893b0bdbb9f..a38898bb238 100644 --- a/litellm/types/litellm_core_utils/streaming_chunk_builder_utils.py +++ b/litellm/types/litellm_core_utils/streaming_chunk_builder_utils.py @@ -1,4 +1,4 @@ -from typing_extensions import TypedDict +from typing_extensions import ReadOnly, TypedDict from ..utils import CompletionTokensDetails, PromptTokensDetailsWrapper, ServerToolUse @@ -13,5 +13,5 @@ class UsagePerChunk(TypedDict): completion_tokens_details: CompletionTokensDetails | None prompt_tokens_details: PromptTokensDetailsWrapper | None cost: float | None - inference_geo: str | None - speed: str | None + inference_geo: ReadOnly[str | None] + speed: ReadOnly[str | None]