File tree Expand file tree Collapse file tree 1 file changed +0
-16
lines changed
litellm/proxy/guardrails/guardrail_hooks Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change @@ -384,9 +384,6 @@ async def make_bedrock_api_request(
384
384
)
385
385
#########################################################
386
386
if response .status_code == 200 :
387
- # check if the response contains an error
388
- if self ._check_bedrock_response_for_exception (response = response ):
389
- raise self ._get_http_exception_for_failed_guardrail (response )
390
387
# check if the response was flagged
391
388
_json_response = response .json ()
392
389
redacted_response = _redact_pii_matches (_json_response )
@@ -452,19 +449,6 @@ def _get_bedrock_guardrail_response_status(
452
449
return "success"
453
450
return "failure"
454
451
455
- def _get_http_exception_for_failed_guardrail (
456
- self , response : httpx .Response
457
- ) -> HTTPException :
458
- return HTTPException (
459
- status_code = 400 ,
460
- detail = {
461
- "error" : "Guardrail application failed." ,
462
- "bedrock_guardrail_response" : json .loads (
463
- response .content .decode ("utf-8" )
464
- ).get ("Output" , {}),
465
- },
466
- )
467
-
468
452
def _get_http_exception_for_blocked_guardrail (
469
453
self , response : BedrockGuardrailResponse
470
454
) -> HTTPException :
You can’t perform that action at this time.
0 commit comments