style: apply black formatting
Some checks failed
Unit Tests: Caching (Redis) / caching-redis (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (proxy-utils, tests/proxy_unit_tests/test_proxy_utils.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py --ignore=tests/proxy_unit_tests/test_p… (push) Has been cancelled
Unit Tests: Security / security (push) Has been cancelled

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

View file

@ -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(

View file

@ -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:

View file

@ -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(

View file

@ -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

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