Skip to main content

parse_sse_stream

Function parse_sse_stream 

Source
pub fn parse_sse_stream<S>(stream: S) -> ChatStream
where S: Stream<Item = Result<Bytes, Error>> + Send + Unpin + 'static,
Expand description

Parse an OpenAI-compatible SSE stream into chat chunks.

This function includes protection against unbounded memory growth by limiting the internal buffer size to MAX_SSE_BUFFER_SIZE.