mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
test UnsupportedParamsError
This commit is contained in:
parent
8ea4b73c27
commit
30c27b3f92
1 changed files with 6 additions and 3 deletions
|
|
@ -2,18 +2,19 @@
|
|||
# This tests chaos monkeys - if random parts of the system are broken / things aren't sent correctly - what happens.
|
||||
# Expect to add more edge cases to this over time.
|
||||
|
||||
import sys, os
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(
|
||||
0, os.path.abspath("../..")
|
||||
) # Adds the parent directory to the system path
|
||||
import litellm
|
||||
from litellm import embedding, completion
|
||||
from litellm import completion, embedding
|
||||
from litellm.utils import Message
|
||||
|
||||
|
||||
# litellm.set_verbose = True
|
||||
user_message = "Hello, how are you?"
|
||||
messages = [{"content": user_message, "role": "user"}]
|
||||
|
|
@ -74,6 +75,8 @@ def test_completion_invalid_param_cohere():
|
|||
response = completion(model="command-nightly", messages=messages, seed=12)
|
||||
pytest.fail(f"This should have failed cohere does not support `seed` parameter")
|
||||
except Exception as e:
|
||||
assert isinstance(e, litellm.UnsupportedParamsError)
|
||||
print("got an exception=", str(e))
|
||||
if " cohere does not support parameters: {'seed': 12}" in str(e):
|
||||
pass
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue