From adc58ae31f93d3a19c32d5428e70a8b6d2f8ddf5 Mon Sep 17 00:00:00 2001 From: Alberto Perdomo Date: Tue, 27 Oct 2026 11:24:01 +0000 Subject: [PATCH] fix: Satisfy strict lint for stream option access --- litellm/litellm_core_utils/streaming_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index a898bd88eee..ef445de2f1c 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -557,8 +557,8 @@ class CustomStreamWrapper: def check_send_stream_usage(self, stream_options: object) -> bool: if stream_options is None: return False - get_option: Final[Callable[[str, object], object]] = getattr(stream_options, "get") - return get_option("include_usage", False) is True + get_option: Final[Callable[[str, object], object] | None] = getattr(stream_options, "get", None) + return get_option is not None and get_option("include_usage", False) is True def check_is_function_call(self, logging_obj) -> bool: from litellm.litellm_core_utils.prompt_templates.common_utils import (