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(rust): model the blocking OCR hook as a guardrail so its raise propagates (#42775)
devin-ai-integration[bot]59eb943a6e31
diff --git a/tests/test_litellm_rust/ocr/test_callbacks.py b/tests/test_litellm_rust/ocr/test_callbacks.pyindex ac4a1a11a80..d3b04c8bb6f 100644--- a/tests/test_litellm_rust/ocr/test_callbacks.py+++ b/tests/test_litellm_rust/ocr/test_callbacks.py@@ -12,6 +12,7 @@ from hypothesis import HealthCheck, given, settingsfrom hypothesis import strategies as stimport litellm+from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.integrations.custom_logger import CustomLoggerfrom litellm.llms.base_llm.ocr.transformation import OCRResponsefrom tests.test_litellm_rust.support.callback_recorder import RecordingLogger, drain_logging@@ -420,7 +421,7 @@ async def test_native_aocr_state_stashed_before_a_blocking_hook_raises_reaches_fclass Blocked(Exception):pass- class Block(CustomLogger):+ class Block(CustomGuardrail):async def async_post_call_success_deployment_hook(self, request_data, response, call_type):request_data["litellm_logging_obj"].model_call_details["blocked-by"] = tokenraise Blocked("blocked after the provider answered")