diff --git a/litellm/__pycache__/main.cpython-311.pyc b/litellm/__pycache__/main.cpython-311.pyc index 8fc681ffa..fda9a8790 100644 Binary files a/litellm/__pycache__/main.cpython-311.pyc and b/litellm/__pycache__/main.cpython-311.pyc differ diff --git a/litellm/__pycache__/utils.cpython-311.pyc b/litellm/__pycache__/utils.cpython-311.pyc index a36ab177a..4021680ec 100644 Binary files a/litellm/__pycache__/utils.cpython-311.pyc and b/litellm/__pycache__/utils.cpython-311.pyc differ diff --git a/litellm/main.py b/litellm/main.py index 16d6bd29d..ec14064b0 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -218,7 +218,7 @@ def completion( ######## end of unpacking kwargs ########### args = locals() openai_params = ["functions", "function_call", "temperature", "temperature", "top_p", "n", "stream", "stop", "max_tokens", "presence_penalty", "frequency_penalty", "logit_bias", "user", "metadata"] - litellm_params = ["return_async", "mock_response", "api_key", "api_version", "api_base", "force_timeout", "logger_fn", "verbose", "custom_llm_provider", "litellm_logging_obj", "litellm_call_id", "use_client", "id", "metadata", "fallbacks"] + litellm_params = ["caching", "return_async", "mock_response", "api_key", "api_version", "api_base", "force_timeout", "logger_fn", "verbose", "custom_llm_provider", "litellm_logging_obj", "litellm_call_id", "use_client", "id", "metadata", "fallbacks"] default_params = openai_params + litellm_params non_default_params = {k: v for k,v in kwargs.items() if k not in default_params} # model-specific params - pass them straight to the model/provider if mock_response: diff --git a/litellm/tests/test_bad_params.py b/litellm/tests/test_bad_params.py index 8cd1047af..9d3d65d41 100644 --- a/litellm/tests/test_bad_params.py +++ b/litellm/tests/test_bad_params.py @@ -48,7 +48,7 @@ def test_completion_invalid_param_cohere(): try: response = completion(model="command-nightly", messages=messages, top_p=1) except Exception as e: - if "Function calling is not supported by this provider" in str(e): + if "Unsupported parameters passed: top_p" in str(e): pass else: pytest.fail(f'An error occurred {e}') diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 050152708..aa6c858f2 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -531,7 +531,7 @@ def test_completion_openai_with_more_optional_params(): except Exception as e: pytest.fail(f"Error occurred: {e}") - +test_completion_openai_with_more_optional_params() # def test_completion_openai_azure_with_functions(): # function1 = [ # { diff --git a/litellm/utils.py b/litellm/utils.py index 9db751674..798ac457a 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1209,7 +1209,7 @@ def get_optional_params( # use the openai defaults if top_p: optional_params["top_p"] = top_p else: # assume passing in params for openai/azure openai - supported_params = ["functions", "function_call", "temperature", "top_p", "n", "stream", "stop", "max_tokens", "presence_penalty", "logit_bias", "user", "deployment_id"] + supported_params = ["functions", "function_call", "temperature", "top_p", "n", "stream", "stop", "max_tokens", "presence_penalty", "frequency_penalty", "logit_bias", "user", "deployment_id"] _check_valid_arg(supported_params=supported_params) optional_params = non_default_params # if user passed in non-default kwargs for specific providers/models, pass them along