style: ruff format after greploop fixes

This commit is contained in:
Sameer Kankute 2026-07-02 10:57:10 +05:30
parent 84de0ce655
commit 735b14f591
No known key found for this signature in database
2 changed files with 2 additions and 6 deletions

View file

@ -132,9 +132,7 @@ class AnthropicMessagesHandler(BaseTranslation):
def _sse(event_type: str, payload: dict) -> bytes:
return f"event: {event_type}\ndata: {json.dumps(payload)}\n\n".encode()
output_tokens = blocked_response_usage(getattr(exc, "original_response", None))[
"output_tokens"
]
output_tokens = blocked_response_usage(getattr(exc, "original_response", None))["output_tokens"]
open_index, max_index = self._content_block_state(responses_so_far)
new_index = (max_index + 1) if max_index is not None else 0
chunks: list[bytes] = []

View file

@ -166,9 +166,7 @@ async def test_buffered_mode_disabled_for_content_rewriting_guardrail():
the client would get the unredacted original instead of the moderated
output. mask_response_content=True must force buffering off so the
request falls back to the (correctly moderated) non-buffered path."""
guardrail = _PassingGuardrail(
guardrail_name="masker", event_hook="post_call", mask_response_content=True
)
guardrail = _PassingGuardrail(guardrail_name="masker", event_hook="post_call", mask_response_content=True)
raw = await _run(guardrail)
assert guardrail.streaming_buffer_until_moderated is True # request asked for buffering
assert ORIGINAL_MARKER in raw