From 30c27b3f92a772d48e7a59bc74f6edc7b944a9af Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 24 Jul 2024 12:21:22 -0700 Subject: [PATCH] test UnsupportedParamsError --- litellm/tests/test_bad_params.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/litellm/tests/test_bad_params.py b/litellm/tests/test_bad_params.py index 9f126a1b8c0..1b20096e5d0 100644 --- a/litellm/tests/test_bad_params.py +++ b/litellm/tests/test_bad_params.py @@ -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: