mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
(fix) litellm.acompletion with type hints
This commit is contained in:
parent
6e1be43595
commit
cea0d6c8b0
2 changed files with 40 additions and 53 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue