mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-17 09:34:48 +00:00
style(guardrails): apply ruff format to stream_surface and thirdlaw types
Both files drifted from ruff format on this branch and were failing the lint job's ruff format --check step. Formatting only, no behavior change.
This commit is contained in:
parent
198ce2c4ba
commit
d130d29a6e
2 changed files with 2 additions and 6 deletions
|
|
@ -72,8 +72,7 @@ def classify_stream(all_chunks: Sequence[object]) -> StreamSurface:
|
|||
if is_raw_sse_stream(all_chunks):
|
||||
return StreamSurface.ANTHROPIC_MESSAGES if is_anthropic_sse_stream(all_chunks) else StreamSurface.OPAQUE_SSE
|
||||
if any(
|
||||
(event_type := _stream_item_type(chunk)) is not None
|
||||
and event_type.startswith(_RESPONSES_EVENT_TYPE_PREFIX)
|
||||
(event_type := _stream_item_type(chunk)) is not None and event_type.startswith(_RESPONSES_EVENT_TYPE_PREFIX)
|
||||
for chunk in all_chunks
|
||||
):
|
||||
return StreamSurface.RESPONSES
|
||||
|
|
@ -134,9 +133,7 @@ def responses_deltas_absent_from_body(all_chunks: Sequence[object], body: Respon
|
|||
"""
|
||||
encoded_body: Final = json.dumps(body.model_dump(mode="json"), default=str)
|
||||
return tuple(
|
||||
text
|
||||
for text in responses_delta_field_texts(all_chunks)
|
||||
if text and json.dumps(text)[1:-1] not in encoded_body
|
||||
text for text in responses_delta_field_texts(all_chunks) if text and json.dumps(text)[1:-1] not in encoded_body
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@ class ThirdlawGuardrailConfigModelOptionalParams(BaseModel):
|
|||
)
|
||||
|
||||
|
||||
|
||||
class ThirdlawGuardrailConfigModel(GuardrailConfigModel[ThirdlawGuardrailConfigModelOptionalParams]):
|
||||
api_base: str | None = Field(
|
||||
default=None,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue