mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
test(test_async_fn.py): catch timeouts
This commit is contained in:
parent
9f51462933
commit
8e430fcfbe
1 changed files with 5 additions and 4 deletions
|
@ -20,6 +20,8 @@ def test_sync_response():
|
|||
try:
|
||||
response = completion(model="gpt-3.5-turbo", messages=messages, timeout=5)
|
||||
print(f"response: {response}")
|
||||
except litellm.Timeout as e:
|
||||
pass
|
||||
except Exception as e:
|
||||
pytest.fail(f"An exception occurred: {e}")
|
||||
# test_sync_response()
|
||||
|
@ -29,12 +31,11 @@ def test_sync_response_anyscale():
|
|||
user_message = "Hello, how are you?"
|
||||
messages = [{"content": user_message, "role": "user"}]
|
||||
try:
|
||||
response = completion(model="anyscale/mistralai/Mistral-7B-Instruct-v0.1", messages=messages)
|
||||
response = completion(model="anyscale/mistralai/Mistral-7B-Instruct-v0.1", messages=messages, timeout=5)
|
||||
except litellm.Timeout as e:
|
||||
pass
|
||||
except Exception as e:
|
||||
pytest.fail(f"An exception occurred: {e}")
|
||||
test_sync_response()
|
||||
print(f"STARTING ANYSCALE RESPONSE")
|
||||
test_sync_response_anyscale()
|
||||
# test_sync_response_anyscale()
|
||||
|
||||
def test_async_response_openai():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue