mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
litellm_fix(ci): combined CI fixes for timezone import, mypy types, and callback_name
This commit combines multiple CI fixes: 1. Fix timezone import in proxy_server.py - Add 'timezone' to datetime imports - timezone.utc was used but not imported 2. Fix mypy type errors in transformation.py - Change Dict[str, Optional[int]] to Dict[str, int] - Values are only assigned when not None 3. Fix mypy type error in opentelemetry.py - Add fallback 'opentelemetry' for callback_name when it's None
This commit is contained in:
parent
3f1bda57e2
commit
1876272aa2
3 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue