(fix) litellm.acompletion with type hints

This commit is contained in:
ishaan-jaff 2024-01-11 10:47:12 +05:30
parent 6e1be43595
commit cea0d6c8b0
2 changed files with 40 additions and 53 deletions

View file

@ -15,22 +15,6 @@ from litellm import completion, acompletion, acreate
litellm.num_retries = 3
def test_sync_response():
litellm.set_verbose = False
user_message = "Hello, how are you?"
messages = [{"content": user_message, "role": "user"}]
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()
def test_sync_response_anyscale():
litellm.set_verbose = False
user_message = "Hello, how are you?"
@ -197,6 +181,7 @@ def test_get_cloudflare_response_streaming():
asyncio.run(test_async_call())
@pytest.mark.asyncio
async def test_hf_completion_tgi():
# litellm.set_verbose=True
@ -212,6 +197,7 @@ async def test_hf_completion_tgi():
except Exception as e:
pytest.fail(f"Error occurred: {e}")
# test_get_cloudflare_response_streaming()