Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix RerankResponse type

Ishaan Jaffd1342c59917a
diff --git a/litellm/rerank_api/types.py b/litellm/rerank_api/types.py
index 605e25a2ecb..3b95597c310 100644
--- a/litellm/rerank_api/types.py
+++ b/litellm/rerank_api/types.py
@@ -23,3 +23,16 @@ class RerankResponse(BaseModel):
id: str
results: List[dict] # Contains index and relevance_score
meta: dict # Contains api_version and billed_units
+ _hidden_params: Optional[dict] = {}
+
+ class Config:
+ underscore_attrs_are_private = True
+
+ def __getitem__(self, key):
+ return self.__dict__[key]
+
+ def get(self, key, default=None):
+ return self.__dict__.get(key, default)
+
+ def __contains__(self, key):
+ return key in self.__dict__