mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
fix(guardrails): raise 500 when Bedrock reports a failure inside a 200 body
Also types the credentials parameter on the new chunking helpers and rebuilds fragment grouping without mutating a list or rebinding an index
This commit is contained in:
parent
a6ad663af1
commit
a08e4cf309
1 changed files with 2 additions and 1 deletions
|
|
@ -4616,12 +4616,13 @@ async def test_apply_guardrail_exception_inside_200_logs_failure_not_success():
|
|||
):
|
||||
mock_post.return_value = exception_response
|
||||
|
||||
with pytest.raises(HTTPException):
|
||||
with pytest.raises(HTTPException) as raised:
|
||||
await guardrail.make_bedrock_api_request(
|
||||
source="INPUT",
|
||||
messages=[{"role": "user", "content": "hello"}],
|
||||
request_data={"model": "bedrock-nova-micro"},
|
||||
)
|
||||
|
||||
assert raised.value.status_code == 500
|
||||
mock_log.assert_called_once()
|
||||
assert mock_log.call_args.kwargs["guardrail_status"] == "guardrail_failed_to_respond"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue