diff --git a/tests/test_litellm/interactions/base_interactions_test.py b/tests/test_litellm/interactions/base_interactions_test.py index b7748a45f32..bbf2296928e 100644 --- a/tests/test_litellm/interactions/base_interactions_test.py +++ b/tests/test_litellm/interactions/base_interactions_test.py @@ -52,10 +52,21 @@ class BaseInteractionsTest(ABC): if response.usage: # Usage is a dict in InteractionsAPIResponse if isinstance(response.usage, dict): - assert response.usage.get("input_tokens") is not None or response.usage.get("output_tokens") is not None + # Check for both old format (input_tokens/output_tokens) and new format (total_input_tokens/total_output_tokens) + assert ( + response.usage.get("input_tokens") is not None + or response.usage.get("output_tokens") is not None + or response.usage.get("total_input_tokens") is not None + or response.usage.get("total_output_tokens") is not None + ) else: # If it's an object, check attributes - assert hasattr(response.usage, "input_tokens") or hasattr(response.usage, "output_tokens") + assert ( + hasattr(response.usage, "input_tokens") + or hasattr(response.usage, "output_tokens") + or hasattr(response.usage, "total_input_tokens") + or hasattr(response.usage, "total_output_tokens") + ) def test_create_with_system_instruction(self): """Test creating an interaction with system_instruction.""" diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index cd76c438ded..07a0e3f8fa3 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -1064,7 +1064,8 @@ class TestProxyFunctionCalling: ("gemini/gemini-1.5-pro", "litellm_proxy/gemini/gemini-1.5-pro", True), ("gemini/gemini-1.5-flash", "litellm_proxy/gemini/gemini-1.5-flash", True), # Groq models (mixed support) - ("groq/gemma-7b-it", "litellm_proxy/groq/gemma-7b-it", True), + # Note: groq/gemma-7b-it is not in model_prices_and_context_window.json, so supports_function_calling returns False + ("groq/gemma-7b-it", "litellm_proxy/groq/gemma-7b-it", False), ( "groq/llama-3.3-70b-versatile", "litellm_proxy/groq/llama-3.3-70b-versatile",