mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
refactor: add black formatting
This commit is contained in:
parent
b87d630b0a
commit
4905929de3
156 changed files with 19723 additions and 10869 deletions
|
@ -28,6 +28,7 @@ def logger_fn(user_model_dict):
|
|||
# print(f"user_model_dict: {user_model_dict}")
|
||||
pass
|
||||
|
||||
|
||||
# normal call
|
||||
def test_completion_custom_provider_model_name():
|
||||
try:
|
||||
|
@ -41,25 +42,31 @@ def test_completion_custom_provider_model_name():
|
|||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
|
||||
# completion with num retries + impact on exception mapping
|
||||
def test_completion_with_num_retries():
|
||||
try:
|
||||
response = completion(model="j2-ultra", messages=[{"messages": "vibe", "bad": "message"}], num_retries=2)
|
||||
def test_completion_with_num_retries():
|
||||
try:
|
||||
response = completion(
|
||||
model="j2-ultra",
|
||||
messages=[{"messages": "vibe", "bad": "message"}],
|
||||
num_retries=2,
|
||||
)
|
||||
pytest.fail(f"Unmapped exception occurred")
|
||||
except Exception as e:
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
|
||||
# test_completion_with_num_retries()
|
||||
def test_completion_with_0_num_retries():
|
||||
try:
|
||||
litellm.set_verbose=False
|
||||
litellm.set_verbose = False
|
||||
print("making request")
|
||||
|
||||
# Use the completion function
|
||||
response = completion(
|
||||
model="gpt-3.5-turbo",
|
||||
messages=[{"gm": "vibe", "role": "user"}],
|
||||
max_retries=4
|
||||
max_retries=4,
|
||||
)
|
||||
|
||||
print(response)
|
||||
|
@ -69,5 +76,6 @@ def test_completion_with_0_num_retries():
|
|||
print("exception", e)
|
||||
pass
|
||||
|
||||
|
||||
# Call the test function
|
||||
test_completion_with_0_num_retries()
|
||||
test_completion_with_0_num_retries()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue