Commit 0d3ddfc
authored
fix(streaming): resolve word concatenation in streaming output rails (#1259)
* fix(streaming): resolve word concatenation in streaming output rails
- fix spacing loss in streaming output where words were concatenated without spaces
- refactor BufferStrategy interface with ChunkBatch named tuple for better API design
- improve variable names and add comprehensive Google-style documentation
- add robust exception handling for streaming generation tasks
- enhance test coverage
- remove unnecessary chunk splitting that defeated buffer strategy purpose
Fixes issue where `test_sequential_streaming_output_rails_allowed` failed due to
output like "safeand complianthigh quality" instead of "safe and compliant high quality".
The root cause was in `_run_output_rails_in_streaming` calling `split()` on chunks
that already had proper spacing, then failing to reconstruct the original format.1 parent 8c663c8 commit 0d3ddfc
File tree
4 files changed
+856
-112
lines changed- nemoguardrails/rails/llm
- tests
4 files changed
+856
-112
lines changed
0 commit comments