diff --git a/litellm/__pycache__/main.cpython-311.pyc b/litellm/__pycache__/main.cpython-311.pyc index 9f0a8d2ce..3aecc0cef 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 a7ff83ae4..49bb12921 100644 Binary files a/litellm/__pycache__/utils.cpython-311.pyc and b/litellm/__pycache__/utils.cpython-311.pyc differ diff --git a/litellm/tests/test_bad_params.py b/litellm/tests/test_bad_params.py index 3f015a8e8..046edb46d 100644 --- a/litellm/tests/test_bad_params.py +++ b/litellm/tests/test_bad_params.py @@ -32,6 +32,44 @@ def test_completion_with_empty_model(): pass +def test_completion_function_call_cohere(): + try: + response = completion(model="command-nightly", messages=messages, function_call="TEST-FUNCTION") + except Exception as e: + if "Function calling is not supported by this provider" in str(e): + pass + else: + pytest.fail(f'An error occurred {e}') + +def test_completion_function_call_openai(): + try: + messages = [{"role": "user", "content": "What is the weather like in Boston?"}] + response = completion(model="gpt-3.5-turbo", messages=messages, functions=[ + { + "name": "get_current_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state, e.g. San Francisco, CA" + }, + "unit": { + "type": "string", + "enum": ["celsius", "fahrenheit"] + } + }, + "required": ["location"] + } + } + ]) + print(f"response: {response}") + except: + pass + +# test_completion_function_call_openai() + def test_completion_with_no_provider(): # test on empty try: @@ -52,4 +90,5 @@ def test_completion_with_no_provider(): # except: # print(f"error occurred: {traceback.format_exc()}") # pass -# os.environ["OPENAI_API_KEY"] = str(temp_key) # this passes linting#5 \ No newline at end of file +# os.environ["OPENAI_API_KEY"] = str(temp_key) # this passes linting#5 +