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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test: type the background response retrieval test helpers
mateo-berri547f81c1a527
diff --git a/tests/test_litellm/proxy/policy_engine/test_response_retrieval.py b/tests/test_litellm/proxy/policy_engine/test_response_retrieval.pyindex 8c00b18eb63..b704f666646 100644--- a/tests/test_litellm/proxy/policy_engine/test_response_retrieval.py+++ b/tests/test_litellm/proxy/policy_engine/test_response_retrieval.py@@ -1,4 +1,5 @@import logging+from collections.abc import Mappingimport pytest@@ -76,14 +77,16 @@ def policy_engine():attachment_registry.clear()-def _retrieval_data(model_id: str) -> dict:+def _retrieval_data(model_id: str) -> dict[str, object]:return {"response_id": _encoded_response_id(model_id), "litellm_metadata": {}}-def _attached_pipelines(data: dict) -> tuple[tuple[str, str], ...]:+def _attached_pipelines(data: Mapping[str, object]) -> tuple[tuple[str, str], ...]:+ bucket = data["litellm_metadata"]+ assert isinstance(bucket, dict)return tuple((policy_name, ",".join(step.guardrail for step in pipeline.steps))- for policy_name, pipeline in data["litellm_metadata"]["_guardrail_pipelines"]+ for policy_name, pipeline in bucket["_guardrail_pipelines"])diff --git a/tests/test_litellm/proxy/test_common_request_processing.py b/tests/test_litellm/proxy/test_common_request_processing.pyindex 08007e22cfb..c451a3b4cb0 100644--- a/tests/test_litellm/proxy/test_common_request_processing.py+++ b/tests/test_litellm/proxy/test_common_request_processing.py@@ -8340,7 +8340,7 @@ class TestBackgroundResponseRetrievalGovernance:)return router- async def _pre_call(self, route_type: str, monkeypatch) -> dict:+ async def _pre_call(self, route_type: str, monkeypatch: pytest.MonkeyPatch) -> dict[str, object]:from litellm.responses.utils import ResponsesAPIRequestUtilsclient_facing_response_id = "resp_opaque-client-facing-id"