mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
style(guardrails): drop narrative comments from the deferred logging path
This commit is contained in:
parent
1a5a856e3e
commit
307b471902
3 changed files with 0 additions and 17 deletions
|
|
@ -367,12 +367,6 @@ class BaseAnthropicMessagesStreamingIterator:
|
|||
deferred_dispatch_armed: Final = (
|
||||
getattr(self.litellm_logging_obj, "_on_deferred_stream_complete", None) is not None
|
||||
)
|
||||
# Post-call guardrails run their end-of-stream scan AFTER this iterator
|
||||
# is exhausted, so enqueueing now would build the spend log before the
|
||||
# scan writes guardrail_information. Park the coroutine instead; the
|
||||
# proxy fires it via _fire_deferred_stream_logging once the guardrail
|
||||
# chain drains. Teardown (client disconnect) keeps enqueueing
|
||||
# immediately: the scan never runs there and billing must not be lost.
|
||||
if deferred_dispatch_armed and not stream_teardown:
|
||||
self.litellm_logging_obj._deferred_stream_complete_args = (logging_coroutine,)
|
||||
return
|
||||
|
|
|
|||
|
|
@ -2377,11 +2377,6 @@ class ProxyBaseLLMRequestProcessing:
|
|||
and route_type == "anthropic_messages"
|
||||
and self._is_streaming_response(response)
|
||||
):
|
||||
# Native /v1/messages SSE streams bypass CSW, so the raw
|
||||
# iterator parks its logging coroutine at stream end (see
|
||||
# BaseAnthropicMessagesStreamingIterator._handle_streaming_logging)
|
||||
# and _fire_deferred_stream_logging hands it here after the
|
||||
# guardrail end-of-stream scans complete.
|
||||
from litellm.litellm_core_utils.logging_worker import (
|
||||
GLOBAL_LOGGING_WORKER,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3227,12 +3227,6 @@ class ProxyLogging:
|
|||
),
|
||||
)
|
||||
|
||||
# Actually iterate through the chained async generator and yield chunks.
|
||||
# A guardrail block raised after upstream exhaustion (e.g.
|
||||
# unified_guardrail re-raising HTTPException) must still flush any
|
||||
# parked deferred logging, or the blocked stream loses its spend log.
|
||||
# GeneratorExit/CancelledError stay untouched: disconnect cleanup owns
|
||||
# those.
|
||||
try:
|
||||
async for chunk in current_response:
|
||||
yield chunk
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue