LemonAi.Providers.SSEParser (lemon_ai v0.1.0)

View Source

Shared SSE (Server-Sent Events) stream parser for OpenAI-compatible providers.

Summary

Functions

Parses an SSE chunk buffer into decoded JSON events and any remaining incomplete data.

Functions

parse_sse_chunk(buffer)

Parses an SSE chunk buffer into decoded JSON events and any remaining incomplete data.

Returns {events, incomplete} where events is a list of decoded JSON maps and incomplete is the trailing partial data that should be prepended to the next chunk.