test(test_langfuse.py): handle timeouts

This commit is contained in:
Krrish Dholakia 2023-11-17 17:05:01 -08:00
parent 1ba32368ef
commit 7d70bf84a7
4 changed files with 151 additions and 15 deletions

View file

@ -25,14 +25,16 @@ def test_sync_response():
# test_sync_response()
def test_sync_response_anyscale():
litellm.set_verbose = True
litellm.set_verbose = False
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, timeout=5)
response = completion(model="anyscale/mistralai/Mistral-7B-Instruct-v0.1", messages=messages)
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():