From d2e29ea0ca4effe7217112ffeed0ebe542da6ea5 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Mon, 31 Jul 2023 17:40:08 -0700 Subject: [PATCH] try passing tests --- litellm/main.py | 4 ++-- litellm/tests/test_bad_params.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/main.py b/litellm/main.py index 658ce9996..9de92a372 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -283,8 +283,8 @@ def completion( ], } response = new_response - else: - logging(model=model, input=messages, azure=azure, logger_fn=logger_fn) + else: + raise Exception(f"Model '{model}' not found. Please check your model name and try again.") return response except Exception as e: logging(model=model, input=messages, azure=azure, additional_args={"max_tokens": max_tokens}, logger_fn=logger_fn) diff --git a/litellm/tests/test_bad_params.py b/litellm/tests/test_bad_params.py index 60dd734c9..e7da0f795 100644 --- a/litellm/tests/test_bad_params.py +++ b/litellm/tests/test_bad_params.py @@ -23,6 +23,6 @@ model_val = "krrish is a model" # test on empty try: response = completion(model=model_val, messages=messages) -except: - print(f"error occurred: {traceback.format_exc()}") +except Exception as e: + print(f"error occurred: {e}") pass