Skip to content

Commit 5c00824

Browse files
committed
fix async streaming of structured output
1 parent 6209f67 commit 5c00824

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

guardrails/run/async_stream_runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,11 @@ async def async_step(
279279
validation_response = cast(dict, validated_fragment)
280280
yield ValidationOutcome(
281281
call_id=call_log.id, # type: ignore
282-
raw_llm_output=fragment,
282+
raw_llm_output=validated_fragment,
283283
validated_output=chunk_text,
284284
validation_passed=validated_fragment is not None,
285285
)
286+
fragment = ""
286287

287288
iteration.outputs.raw_output = fragment
288289
# FIXME: Handle case where parsing continuously fails/is a reask

0 commit comments

Comments
 (0)