From c82f28c030404ecea9891d81ba2009dcaed64ba5 Mon Sep 17 00:00:00 2001 From: shivam Date: Thu, 10 Sep 2026 21:48:44 +0000 Subject: [PATCH] fix(vertex_ai): use an immutable default when counting rerank input records Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/llms/vertex_ai/rerank/transformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/vertex_ai/rerank/transformation.py b/litellm/llms/vertex_ai/rerank/transformation.py index d446aa121f0..b0c6add69fd 100644 --- a/litellm/llms/vertex_ai/rerank/transformation.py +++ b/litellm/llms/vertex_ai/rerank/transformation.py @@ -212,7 +212,7 @@ class VertexAIRerankConfig(BaseRerankConfig, VertexBase): RerankResponseResult(index=result["index"], relevance_score=result["relevance_score"]) ) - input_record_count: Final = len(request_data.get("records", [])) + input_record_count: Final = len(request_data.get("records", ())) search_units: Final = math.ceil(input_record_count / self.MAX_RECORDS_PER_SEARCH_UNIT) meta: Final = RerankResponseMeta(billed_units=RerankBilledUnits(search_units=search_units))