mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
style: drop explanatory docstrings from converted-stream helpers and tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
621db91d90
commit
ce45d6a09d
4 changed files with 0 additions and 15 deletions
|
|
@ -109,8 +109,6 @@ def _is_chat_completion_cached_dict(cached_result: dict) -> bool:
|
|||
|
||||
|
||||
def _stream_replay_requested(kwargs: Mapping[str, object]) -> bool:
|
||||
"""True when the caller must receive a stream, including when a deployment hook downgraded
|
||||
`kwargs["stream"]` to False for the provider call."""
|
||||
return kwargs.get("stream", False) is True or converted_stream_requested(kwargs)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -847,8 +847,6 @@ def _is_streaming_response_for_correlation(result: object) -> bool:
|
|||
|
||||
|
||||
def _is_converted_stream_result(result: object) -> bool:
|
||||
"""True if `result` is a lazy stream wrapper the caller must iterate, even when a deployment
|
||||
hook downgraded `kwargs["stream"]` to False for the provider call."""
|
||||
from litellm.litellm_core_utils.streaming_handler import CustomStreamWrapper
|
||||
from litellm.responses.streaming_iterator import BaseResponsesAPIStreamingIterator
|
||||
|
||||
|
|
|
|||
|
|
@ -697,8 +697,6 @@ async def test_cache_hit_records_the_looked_up_key_as_the_preset_cache_key(monke
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_converted_stream_cache_hit_replayed_as_plain_object_logs_at_hit_time(monkeypatch):
|
||||
"""A converted-stream Anthropic Messages request that hits a non-stream cache entry gets a plain dict back,
|
||||
so the success callbacks must fire now; nothing else will fire them."""
|
||||
import litellm
|
||||
from litellm.caching.caching import Cache
|
||||
from litellm.types.utils import CallTypes
|
||||
|
|
|
|||
|
|
@ -5312,8 +5312,6 @@ async def test_wrapper_async_restores_originating_task_context_after_success(mon
|
|||
|
||||
|
||||
class _ConvertStreamDeploymentHook(CustomLogger):
|
||||
"""Headroom-style interception: downgrade stream=True to a non-streaming provider call."""
|
||||
|
||||
async def async_pre_call_deployment_hook(
|
||||
self, kwargs: dict[str, object], call_type: CallTypes | None
|
||||
) -> dict[str, object] | None:
|
||||
|
|
@ -5372,8 +5370,6 @@ def _assert_cache_hit_logged_as_stream(capture: _SuccessKwargsCapture, success_k
|
|||
async def test_wrapper_async_logs_converted_chat_stream_with_standard_logging_object(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
"""Regression LIT-7729: the fake CustomStreamWrapper hit the non-streaming success path, which
|
||||
built no standard_logging_object and deduped the wrapper's own end-of-stream dispatch."""
|
||||
capture: Final = _install_converted_stream_callbacks(monkeypatch)
|
||||
|
||||
response: Final = await litellm.acompletion(
|
||||
|
|
@ -5400,8 +5396,6 @@ async def test_wrapper_async_logs_converted_chat_stream_with_standard_logging_ob
|
|||
async def test_wrapper_async_logs_converted_responses_stream_with_standard_logging_object(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
"""Regression LIT-7729, Responses surface: the fake MockResponsesAPIStreamingIterator took the
|
||||
same non-streaming success path and lost its standard_logging_object."""
|
||||
from litellm.responses.streaming_iterator import BaseResponsesAPIStreamingIterator
|
||||
|
||||
capture: Final = _install_converted_stream_callbacks(monkeypatch)
|
||||
|
|
@ -5446,8 +5440,6 @@ async def test_wrapper_async_logs_converted_responses_stream_with_standard_loggi
|
|||
async def test_wrapper_async_replays_cached_converted_chat_stream_as_stream(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
"""A cache hit for a converted stream must replay as a stream: the caller still iterates the
|
||||
result even though the deployment hook set kwargs["stream"] to False."""
|
||||
capture: Final = _install_converted_stream_callbacks(monkeypatch)
|
||||
monkeypatch.setattr(litellm, "cache", Cache(type="local"))
|
||||
request: Final = {
|
||||
|
|
@ -5476,7 +5468,6 @@ async def test_wrapper_async_replays_cached_converted_chat_stream_as_stream(
|
|||
async def test_wrapper_async_replays_cached_converted_responses_stream_as_stream(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
"""Responses surface of the cache-hit replay: the hit must come back as a streaming iterator."""
|
||||
from litellm.responses.streaming_iterator import BaseResponsesAPIStreamingIterator
|
||||
|
||||
capture: Final = _install_converted_stream_callbacks(monkeypatch)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue