(test) bedrock timeout

This commit is contained in:
ishaan-jaff 2024-02-09 14:38:17 -08:00
parent 6dc7ded1a6
commit 2c116af596

View file

@ -37,6 +37,28 @@ def test_timeout():
# test_timeout() # test_timeout()
def test_bedrock_timeout():
# this Will Raise a timeout
litellm.set_verbose = True
try:
response = litellm.completion(
model="bedrock/anthropic.claude-instant-v1",
timeout=0.01,
messages=[{"role": "user", "content": "hello, write a 20 pg essay"}],
)
pytest.fail("Did not raise error `openai.APITimeoutError`")
except openai.APITimeoutError as e:
print(
"Passed: Raised correct exception. Got openai.APITimeoutError\nGood Job", e
)
print(type(e))
pass
except Exception as e:
pytest.fail(
f"Did not raise error `openai.APITimeoutError`. Instead raised error type: {type(e)}, Error: {e}"
)
def test_hanging_request_azure(): def test_hanging_request_azure():
litellm.set_verbose = True litellm.set_verbose = True
import asyncio import asyncio