Skip to main content

replay_stream_events

Function replay_stream_events 

Source
pub fn replay_stream_events(
    events: Vec<LlmResponseStreamEvent>,
) -> LlmResponseStream
Expand description

Replays previously buffered events as a stream, preserving their provider payloads.

Pair with LlmResponse::into_agg_retaining_events when a caller had to buffer a response but must still serve the original bytes downstream. Unlike AggLlmResponse::into_stream, this is lossless: preservation survives, so the outbound codec can emit a faithful same-format response instead of a synthetic one.