style: apply black formatting

This commit is contained in:
Chesars
2026-04-22 20:09:53 -03:00
parent 25c0aa8bfd
commit e1e5fcb03e
5 changed files with 12 additions and 12 deletions
@@ -5044,9 +5044,7 @@ def _bedrock_converse_messages_pt( # noqa: PLR0915
assistant_content = _deduplicate_bedrock_content_blocks(
assistant_content, "toolUse"
)
assistant_content = _sort_bedrock_assistant_content_blocks(
assistant_content
)
assistant_content = _sort_bedrock_assistant_content_blocks(assistant_content)
if assistant_content:
contents.append(
@@ -119,9 +119,7 @@ class ChunkProcessor:
model = ChunkProcessor._get_model_from_chunks(chunks, first_chunk_model)
system_fingerprint = chunk.get("system_fingerprint", None)
first_chunk_with_choices = next(
(c for c in chunks if c.get("choices")), chunk
)
first_chunk_with_choices = next((c for c in chunks if c.get("choices")), chunk)
role = first_chunk_with_choices["choices"][0]["delta"]["role"]
finish_reason = "stop"
for chunk in chunks:
@@ -1872,7 +1872,9 @@ class CustomStreamWrapper:
if response.choices:
choice = response.choices[0]
if isinstance(choice, StreamingChoices):
self.response_uptil_now += choice.delta.get("content", "") or ""
self.response_uptil_now += (
choice.delta.get("content", "") or ""
)
else:
self.response_uptil_now += ""
self.rules.post_call_rules(
@@ -2053,7 +2055,9 @@ class CustomStreamWrapper:
if processed_chunk.choices:
choice = processed_chunk.choices[0]
if isinstance(choice, StreamingChoices):
self.response_uptil_now += choice.delta.get("content", "") or ""
self.response_uptil_now += (
choice.delta.get("content", "") or ""
)
else:
self.response_uptil_now += ""
self.rules.post_call_rules(
@@ -95,7 +95,9 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):
temperature = params.get("temperature")
if temperature is not None and temperature != 1:
reasoning = params.get("reasoning") or {}
effort = reasoning.get("effort") if isinstance(reasoning, dict) else None
effort = (
reasoning.get("effort") if isinstance(reasoning, dict) else None
)
supports_none = self._supports_reasoning_effort_none(model=model)
if supports_none and (effort == "none" or effort is None):
pass # flexible temperature allowed
+1 -3
View File
@@ -7389,9 +7389,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