mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
test(rust): model the blocking OCR hook as a guardrail so its raise propagates (#42775)
Co-authored-by: Yujong Lee <yujong@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
9fd25b2228
commit
59eb943a6e
1 changed files with 2 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ from hypothesis import HealthCheck, given, settings
|
|||
from hypothesis import strategies as st
|
||||
|
||||
import litellm
|
||||
from litellm.integrations.custom_guardrail import CustomGuardrail
|
||||
from litellm.integrations.custom_logger import CustomLogger
|
||||
from litellm.llms.base_llm.ocr.transformation import OCRResponse
|
||||
from 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_f
|
|||
class 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"] = token
|
||||
raise Blocked("blocked after the provider answered")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue