mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
test: type the background response retrieval test helpers
This commit is contained in:
parent
071f83980c
commit
547f81c1a5
2 changed files with 7 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import logging
|
||||
from collections.abc import Mapping
|
||||
|
||||
import 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"]
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 ResponsesAPIRequestUtils
|
||||
|
||||
client_facing_response_id = "resp_opaque-client-facing-id"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue