mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
litellm_fix(test): fix Azure AI cost calculator test - use Logging class (#20134)
This commit is contained in:
parent
ecd0202f70
commit
013b4701f4
1 changed files with 13 additions and 3 deletions
|
|
@ -273,12 +273,22 @@ class TestAzureModelRouterCostBreakdown:
|
|||
|
||||
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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue