Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix code qa checks

Ishaan Jaff59aaef07efde
diff --git a/litellm/litellm_core_utils/llm_cost_calc/tool_call_cost_tracking.py b/litellm/litellm_core_utils/llm_cost_calc/tool_call_cost_tracking.py
index 1b73e480002..4ecc4a33702 100644
--- a/litellm/litellm_core_utils/llm_cost_calc/tool_call_cost_tracking.py
+++ b/litellm/litellm_core_utils/llm_cost_calc/tool_call_cost_tracking.py
@@ -2,7 +2,7 @@
Helper utilities for tracking the cost of built-in tools.
"""
-from typing import Any, Dict, List, Literal, Optional
+from typing import Any, Dict, List, Literal, Optional, Tuple
import litellm
from litellm.constants import OPENAI_FILE_SEARCH_COST_PER_1K_CALLS
@@ -163,7 +163,7 @@ class StandardBuiltInToolCostTracking:
return total_cost
@staticmethod
- def _extract_file_search_params(file_search_usage: Any) -> tuple[Optional[float], Optional[float]]:
+ def _extract_file_search_params(file_search_usage: Any) -> Tuple[Optional[float], Optional[float]]:
"""Extract and convert file search parameters safely."""
storage_gb = None
days = None
@@ -519,7 +519,10 @@ class StandardBuiltInToolCostTracking:
return total_cost
# Azure default pricing
- from litellm.constants import AZURE_COMPUTER_USE_INPUT_COST_PER_1K_TOKENS, AZURE_COMPUTER_USE_OUTPUT_COST_PER_1K_TOKENS
+ from litellm.constants import (
+ AZURE_COMPUTER_USE_INPUT_COST_PER_1K_TOKENS,
+ AZURE_COMPUTER_USE_OUTPUT_COST_PER_1K_TOKENS,
+ )
total_cost = 0.0
if input_tokens:
total_cost += (input_tokens / 1000.0) * AZURE_COMPUTER_USE_INPUT_COST_PER_1K_TOKENS