From c1279ed809f10b415fb836de2aef90f54e77d65c Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 13 Aug 2024 20:35:18 -0700 Subject: [PATCH] fix(bedrock_httpx.py): fix error code for not found provider/model combo to be 404 --- litellm/llms/bedrock_httpx.py | 4 ++-- litellm/tests/test_bedrock_completion.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/llms/bedrock_httpx.py b/litellm/llms/bedrock_httpx.py index ffc096f762..c433c32b7d 100644 --- a/litellm/llms/bedrock_httpx.py +++ b/litellm/llms/bedrock_httpx.py @@ -1055,8 +1055,8 @@ class BedrockLLM(BaseLLM): }, ) raise BedrockError( - status_code=400, - message="Bedrock HTTPX: Unsupported provider={}, model={}".format( + status_code=404, + message="Bedrock HTTPX: Unknown provider={}, model={}".format( provider, model ), ) diff --git a/litellm/tests/test_bedrock_completion.py b/litellm/tests/test_bedrock_completion.py index 4da18144d0..c331021213 100644 --- a/litellm/tests/test_bedrock_completion.py +++ b/litellm/tests/test_bedrock_completion.py @@ -1159,8 +1159,8 @@ def test_bedrock_tools_pt_invalid_names(): assert result[1]["toolSpec"]["name"] == "another_invalid_name" -def test_bad_request_error(): - with pytest.raises(litellm.BadRequestError): +def test_not_found_error(): + with pytest.raises(litellm.NotFoundError): completion( model="bedrock/bad_model", messages=[