diff --git a/litellm/main.py b/litellm/main.py index f2da7230595..4299304f482 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -7388,9 +7388,7 @@ def stream_chunk_builder( # noqa: PLR0915 if len(chunks) == 0: return None ## Route to the text completion logic - first_chunk_with_choices = next( - (c for c in chunks if c["choices"]), None - ) + first_chunk_with_choices = next((c for c in chunks if c["choices"]), None) if first_chunk_with_choices is not None and isinstance( first_chunk_with_choices["choices"][0], litellm.utils.TextChoices ): # route to the text completion logic