Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def initialize_guardrail(litellm_params: "LitellmParams", guardrail: "Guardrail"
**{
**litellm_params.model_dump(),
"guardrail_name": guardrail_name,
"event_hook": litellm_params.mode,
"default_on": litellm_params.default_on or False,
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ async def async_pre_call_hook(
return None

@log_guardrail_information
async def async_post_call_hook(
async def async_post_call_success_hook(
self,
data: Dict[str, Any],
user_api_key_dict: UserAPIKeyAuth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ async def test_safe_response_allowed(
mock_response = {"action": "allow", "category": "benign"}

with patch.object(handler, "_call_panw_api", return_value=mock_response):
result = await handler.async_post_call_hook(
result = await handler.async_post_call_success_hook(
data=request_data,
user_api_key_dict=user_api_key_dict,
response=safe_response,
Expand All @@ -299,7 +299,7 @@ async def test_harmful_response_blocked(

with patch.object(handler, "_call_panw_api", return_value=mock_response):
with pytest.raises(HTTPException) as exc_info:
await handler.async_post_call_hook(
await handler.async_post_call_success_hook(
data=request_data,
user_api_key_dict=user_api_key_dict,
response=harmful_response,
Expand Down
Loading