From 96e12ac926cf73eaf3317a96a715b1e0f5cf0f2b Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Sat, 21 Feb 2026 10:00:50 -0800 Subject: [PATCH] fix(mypy): add type annotations in test_eval.py --- .../guardrail_benchmarks/test_eval.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py b/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py index 61c724b1836..212b7f49c2f 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py +++ b/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py @@ -20,7 +20,7 @@ import json import os import time from datetime import datetime, timezone -from typing import List +from typing import Any, List import pytest from fastapi import HTTPException @@ -59,7 +59,7 @@ def _run(checker, text: str) -> dict: return {"decision": "ALLOW", "score": 0.0, "matched_topic": None} except HTTPException as e: if e.status_code == 403: - detail = e.detail if isinstance(e.detail, dict) else {} + detail: dict[str, Any] = e.detail if isinstance(e.detail, dict) else {} return { "decision": "BLOCK", "score": detail.get("score", 1.0), @@ -216,7 +216,7 @@ def _content_filter(category: str): guardrail = ContentFilterGuardrail( guardrail_name=f"{category}_eval", - categories=[ # type: ignore[arg-type] + categories=[ # type: ignore[arg-type,list-item] { "category": category, "enabled": True,