fix(guardrails): require privaite>=0.7.2

0.7.2 turns off the ONNX Runtime telemetry that older releases send from the process hosting the engine, which here is the proxy itself
This commit is contained in:
crp4222 2026-10-05 16:12:36 +02:00
parent c6505635ec
commit 5939dda0aa
2 changed files with 10 additions and 1 deletions

View file

@ -372,7 +372,7 @@ class PrivaiteGuardrail(CustomGuardrail):
except ImportError as exc: # pragma: no cover
raise RuntimeError(
"The PrivAiTe guardrail requires the 'privaite' package. "
"Install it with: pip install 'privaite>=0.4.2'"
"Install it with: pip install 'privaite>=0.7.2'"
) from exc
if self.block_entities and "block_entities" not in PIIConfig.model_fields:

View file

@ -293,6 +293,15 @@ def test_event_hook_always_includes_pre_and_post():
assert "pre_call" in gr3.event_hook and "post_call" in gr3.event_hook
@pytest.mark.asyncio
async def test_engine_missing_privaite_recommends_safe_minimum(monkeypatch: pytest.MonkeyPatch) -> None:
guardrail = _make_guardrail()
monkeypatch.setitem(sys.modules, "privaite.config.schema", None)
with pytest.raises(RuntimeError, match=r"pip install 'privaite>=0\.7\.2'"):
await guardrail._engine_for(["en"])
@pytest.mark.asyncio
async def test_engine_is_cached():
gr = _make_guardrail()