diff --git a/litellm/litellm_core_utils/core_helpers.py b/litellm/litellm_core_utils/core_helpers.py index 800973573c9..8dec2941e02 100644 --- a/litellm/litellm_core_utils/core_helpers.py +++ b/litellm/litellm_core_utils/core_helpers.py @@ -123,7 +123,7 @@ def proxy_request_headers(container: Mapping[str, object] | None) -> Mapping[str def stream_cost_injection_requested(request_headers: Mapping[str, object] | None) -> bool: """The global include_cost_in_streaming_usage flag or the per-request header asks for usage.cost on streams.""" - if bool(getattr(litellm, "include_cost_in_streaming_usage", False)): + if litellm.include_cost_in_streaming_usage: return True if not request_headers: return False diff --git a/litellm/litellm_core_utils/prompt_templates/reasoning_utils.py b/litellm/litellm_core_utils/prompt_templates/reasoning_utils.py index ff1f2e017e3..7773c189b53 100644 --- a/litellm/litellm_core_utils/prompt_templates/reasoning_utils.py +++ b/litellm/litellm_core_utils/prompt_templates/reasoning_utils.py @@ -282,14 +282,6 @@ def anthropic_content_lists(messages: Sequence[object]) -> Iterator[object]: ) -def _content_carries_encrypted_reasoning(content: object) -> bool: - return any(is_encrypted_reasoning_block(block) for block in _object_sequence(content)) - - -def messages_carry_encrypted_reasoning(messages: Sequence[object]) -> bool: - return any(_content_carries_encrypted_reasoning(content) for content in anthropic_content_lists(messages)) - - def _strip_encrypted_reasoning_from_blocks( content: object, *, diff --git a/litellm/llms/custom_httpx/http_handler.py b/litellm/llms/custom_httpx/http_handler.py index 0cfdbc74227..307d67bab21 100644 --- a/litellm/llms/custom_httpx/http_handler.py +++ b/litellm/llms/custom_httpx/http_handler.py @@ -663,7 +663,9 @@ class HTTPResponseLimitError(ValueError): class MaskedHTTPStatusError(httpx.HTTPStatusError): - def __init__(self, original_error: httpx.HTTPStatusError, message: str | None = None, text: str | None = None): + def __init__( + self, original_error: httpx.HTTPStatusError, message: str | None = None, text: str | None = None + ) -> None: # Create a new error with the masked URL masked_url: Final = mask_sensitive_info(str(original_error.request.url)) # Mask the original exception message too (it contains the full URL)