Skip to main content

encode_stream

Function encode_stream 

Source
pub fn encode_stream(
    chunks: LlmResponseStream,
    target: WireFormat,
    served_model: Option<String>,
) -> Result<RawEventStream, LlmClientError>
Expand description

Encodes a stream of IR chunks into a stream of target-format wire events.

served_model is exposed as the response model (via the stream state’s target_model); None falls back to the id observed on the source stream. The target stream codec is resolved once and reused per chunk; terminal events (message_stop / response.completed) come from finish.