From 4ea0eddc2eeb5b04cc2f4888bb2d5993b69f88cc Mon Sep 17 00:00:00 2001 From: Shin Bot Date: Sat, 31 Jan 2026 08:35:50 +0000 Subject: [PATCH] litellm_fix(test): fix Azure AI cost calculator test - use Logging class Bug: test_additional_costs_in_cost_breakdown imports non-existent LitellmLoggingObject Fix: Use Logging class with required parameters This is a new test bug introduced in PR #20091, not a regression. --- .../llms/azure_ai/test_cost_calculator.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/test_litellm/llms/azure_ai/test_cost_calculator.py b/tests/test_litellm/llms/azure_ai/test_cost_calculator.py index aab8f8bf926..03bf0a66a48 100644 --- a/tests/test_litellm/llms/azure_ai/test_cost_calculator.py +++ b/tests/test_litellm/llms/azure_ai/test_cost_calculator.py @@ -273,12 +273,22 @@ def test_flat_cost_integration_with_completion_cost(self): def test_additional_costs_in_cost_breakdown(self): """Test that Azure Model Router flat cost appears in additional_costs dict.""" + from datetime import datetime + from litellm.cost_calculator import completion_cost - from litellm.litellm_core_utils.litellm_logging import LitellmLoggingObject + from litellm.litellm_core_utils.litellm_logging import Logging from litellm.types.utils import Choices, Message, ModelResponse, Usage - # Create logging object - logging_obj = LitellmLoggingObject() + # Create logging object with required parameters + logging_obj = Logging( + model="azure-model-router", + messages=[{"role": "user", "content": "Hello"}], + stream=False, + call_type="completion", + start_time=datetime.now(), + litellm_call_id="test-123", + function_id="test-function", + ) # Create a mock response for azure_ai model router response = ModelResponse(