From 18947f8c856b501ed69104820ed57a2bfa786ed0 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 4 Mar 2024 18:31:18 -0800 Subject: [PATCH] test(test_add_function_to_prompt.py): skip as anthropic now supports tool calling --- litellm/llms/anthropic.py | 2 +- litellm/tests/test_add_function_to_prompt.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/llms/anthropic.py b/litellm/llms/anthropic.py index 047616cfe51..5e088790124 100644 --- a/litellm/llms/anthropic.py +++ b/litellm/llms/anthropic.py @@ -227,7 +227,7 @@ def completion( else: text_content = completion_response["content"][0].get("text", None) ## TOOL CALLING - OUTPUT PARSE - if _is_function_call == True: + if text_content is not None and "invoke" in text_content: function_name = extract_between_tags("tool_name", text_content)[0] function_arguments_str = extract_between_tags("invoke", text_content)[ 0 diff --git a/litellm/tests/test_add_function_to_prompt.py b/litellm/tests/test_add_function_to_prompt.py index 93b09cd8c8b..d703ce849e2 100644 --- a/litellm/tests/test_add_function_to_prompt.py +++ b/litellm/tests/test_add_function_to_prompt.py @@ -41,10 +41,11 @@ def test_function_call_non_openai_model(): pass -test_function_call_non_openai_model() +# test_function_call_non_openai_model() ## case 2: add_function_to_prompt set +@pytest.mark.skip(reason="Anthropic now supports tool calling") def test_function_call_non_openai_model_litellm_mod_set(): litellm.add_function_to_prompt = True litellm.set_verbose = True