mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +00:00
* fix(guardrails): guardrail Bedrock Converse stream text per content block The buffered converse-stream guardrail joined every text delta of the same kind across all content blocks into one string, guardrailed it, then split the result back over the frames by length. When a guardrail edit changed the length (a mask), characters moved between blocks: text spilled from one text block into the next, and parallel toolUse inputs became invalid JSON. Group fragments per (contentBlockIndex, kind) so each block is guardrailed and written back on its own. * test(guardrails): run the Bedrock stream block tests through the real post-call hook Drive de_anonymize_event_stream with a real ProxyLogging and pass-through logging object, with a fake guardrail at the boundary, and assert the texts the guardrail receives as well as the frames the client gets back * test(guardrails): pin the logging start time in the Bedrock stream tests |
||
|---|---|---|
| .. | ||
| guardrail_translation | ||
| __init__.py | ||
| test_bedrock_passthrough_transformation.py | ||