fix(litellm_logging): declare _defer_async_logging and _enqueue_deferred_logging on Logging class for mypy

This commit is contained in:
Ishaan Jaffer 2026-04-24 16:01:54 -07:00
parent 801d7713f4
commit 8090b29a4b
No known key found for this signature in database

View file

@ -416,6 +416,12 @@ class Logging(LiteLLMLoggingBaseClass):
"model": model,
}
# Set by proxy request handlers to defer spend-log fire until after
# post_call guardrails have run; the @client decorator then stores the
# enqueue closure here instead of firing it immediately.
self._defer_async_logging: bool = False
self._enqueue_deferred_logging: Optional[Callable[[], None]] = None
def process_dynamic_callbacks(self):
"""
Initializes CustomLogger compatible callbacks in self.dynamic_* callbacks