diff --git a/.gitignore b/.gitignore index 32f1b6f8e1f..39186159fe0 100644 --- a/.gitignore +++ b/.gitignore @@ -98,4 +98,4 @@ LAZY_LOADING_IMPROVEMENTS.md **/test-results **/playwright-report **/*.storageState.json -**/coverage \ No newline at end of file +**/coveragelitellm/.mypy_cache/ diff --git a/litellm/integrations/opentelemetry.py b/litellm/integrations/opentelemetry.py index 997dd044a65..18898be7dce 100644 --- a/litellm/integrations/opentelemetry.py +++ b/litellm/integrations/opentelemetry.py @@ -1631,7 +1631,7 @@ class OpenTelemetry(CustomLogger): ) except Exception as e: - self.handle_callback_failure(callback_name= self.callback_name) + self.handle_callback_failure(callback_name=self.callback_name or "opentelemetry") verbose_logger.exception( "OpenTelemetry logging error in set_attributes %s", str(e) ) diff --git a/litellm/proxy/common_request_processing.py b/litellm/proxy/common_request_processing.py index 136ce696511..d3f01f3bd2c 100644 --- a/litellm/proxy/common_request_processing.py +++ b/litellm/proxy/common_request_processing.py @@ -623,7 +623,7 @@ class ProxyBaseLLMRequestProcessing: return self.data, logging_obj - async def base_process_llm_request( + async def base_process_llm_request( # noqa: PLR0915 self, request: Request, fastapi_response: Response, diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 078ce0edf27..a00f1f605a9 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -11,7 +11,7 @@ import sys import time import traceback import warnings -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone import enum from typing import ( TYPE_CHECKING, diff --git a/litellm/responses/litellm_completion_transformation/transformation.py b/litellm/responses/litellm_completion_transformation/transformation.py index 41abbca755c..74cc87713da 100644 --- a/litellm/responses/litellm_completion_transformation/transformation.py +++ b/litellm/responses/litellm_completion_transformation/transformation.py @@ -1743,7 +1743,7 @@ class LiteLLMCompletionResponsesConfig: and usage.prompt_tokens_details is not None ): prompt_details = usage.prompt_tokens_details - input_details_dict: Dict[str, Optional[int]] = {} + input_details_dict: Dict[str, int] = {} if ( hasattr(prompt_details, "cached_tokens") @@ -1776,7 +1776,7 @@ class LiteLLMCompletionResponsesConfig: and usage.completion_tokens_details is not None ): completion_details = usage.completion_tokens_details - output_details_dict: Dict[str, Optional[int]] = {} + output_details_dict: Dict[str, int] = {} if ( hasattr(completion_details, "reasoning_tokens") and completion_details.reasoning_tokens is not None