Skip to main content

decode_stream

Function decode_stream 

Source
pub fn decode_stream<S>(
    bytes: S,
    source: WireFormat,
) -> Result<LlmResponseStream, LlmClientError>
where S: Stream<Item = Result<Vec<u8>, LlmClientError>> + Send + 'static,
Expand description

Decodes a byte stream of source-format SSE frames into neutral IR chunks.

Operates on raw bytes, not any HTTP client type: the caller adapts its transport’s body stream into Stream<Item = Result<Vec<u8>, _>>. Frames are buffered across chunks (a partial frame waits for its boundary); the source stream codec is resolved once and reused for every frame.