diff --git a/litellm/__pycache__/__init__.cpython-311.pyc b/litellm/__pycache__/__init__.cpython-311.pyc index 06c2492ab2..7aabe126da 100644 Binary files a/litellm/__pycache__/__init__.cpython-311.pyc and b/litellm/__pycache__/__init__.cpython-311.pyc differ diff --git a/litellm/__pycache__/main.cpython-311.pyc b/litellm/__pycache__/main.cpython-311.pyc index b2cd86d3be..9d440cdce1 100644 Binary files a/litellm/__pycache__/main.cpython-311.pyc and b/litellm/__pycache__/main.cpython-311.pyc differ diff --git a/litellm/__pycache__/timeout.cpython-311.pyc b/litellm/__pycache__/timeout.cpython-311.pyc index 71dcdd3131..60c6b65bdf 100644 Binary files a/litellm/__pycache__/timeout.cpython-311.pyc and b/litellm/__pycache__/timeout.cpython-311.pyc differ diff --git a/litellm/__pycache__/utils.cpython-311.pyc b/litellm/__pycache__/utils.cpython-311.pyc index c11969fb69..3cfcaa33ae 100644 Binary files a/litellm/__pycache__/utils.cpython-311.pyc and b/litellm/__pycache__/utils.cpython-311.pyc differ diff --git a/litellm/llms/anthropic.py b/litellm/llms/anthropic.py index fa1c47c3b6..854af54c1f 100644 --- a/litellm/llms/anthropic.py +++ b/litellm/llms/anthropic.py @@ -26,7 +26,7 @@ class AnthropicConfig(): to pass metadata to anthropic, it's {"user_id": "any-relevant-information"} """ max_tokens_to_sample: Optional[int]=256 # anthropic requires a default - stop_sequences: Optional[list[str]]=None + stop_sequences: Optional[list]=None temperature: Optional[int]=None top_p: Optional[int]=None top_k: Optional[int]=None @@ -34,7 +34,7 @@ class AnthropicConfig(): def __init__(self, max_tokens_to_sample: Optional[int]=256, # anthropic requires a default - stop_sequences: Optional[list[str]]=None, + stop_sequences: Optional[list]=None, temperature: Optional[int]=None, top_p: Optional[int]=None, top_k: Optional[int]=None, diff --git a/litellm/main.py b/litellm/main.py index cfb7cc35e4..8f4b15bca3 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -223,7 +223,7 @@ def completion( fallbacks = kwargs.get('fallbacks', []) ######## end of unpacking kwargs ########### openai_params = ["functions", "function_call", "temperature", "temperature", "top_p", "n", "stream", "stop", "max_tokens", "presence_penalty", "frequency_penalty", "logit_bias", "user", "request_timeout"] - litellm_params = ["metadata", "acompletion", "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"] + litellm_params = ["metadata", "acompletion", "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", "azure"] 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: @@ -239,7 +239,9 @@ def completion( ] # update the model to the actual value if an alias has been passed in model_response = ModelResponse() - if deployment_id != None: # azure llms + if kwargs['azure'] == True: # don't remove flag check, to remain backwards compatible for repos like Codium + custom_llm_provider="azure" + if deployment_id != None: # azure llms model=deployment_id custom_llm_provider="azure" model, custom_llm_provider = get_llm_provider(model=model, custom_llm_provider=custom_llm_provider) diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index f8ffc9c472..373f2bae07 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -365,7 +365,7 @@ def test_completion_openai(): litellm.api_key = None except Exception as e: pytest.fail(f"Error occurred: {e}") -test_completion_openai() +# test_completion_openai() def test_completion_openai_prompt(): @@ -570,17 +570,25 @@ def test_completion_openai_with_more_optional_params(): def test_completion_azure(): try: - print("azure gpt-3.5 test\n\n") + litellm.set_verbose=True + ## Test azure call response = completion( model="azure/chatgpt-v-2", messages=messages, + azure=True + ) + ## Test azure flag for backwards compatibility + response = completion( + model="chatgpt-v-2", + messages=messages, + azure=True ) # Add any assertions here to check the response print(response) except Exception as e: pytest.fail(f"Error occurred: {e}") -# test_completion_azure() +test_completion_azure() # new azure test for using litellm. vars, # use the following vars in this test and make an azure_api_call