Helper module for parsing Server-Sent Events (SSE) from LLM APIs.
Summary
Functions
Parses a raw SSE line and extracts the data payload.
Accumulates streamed chunks into a single content string. Useful for non-streaming consumers or testing.
Functions
Parses a raw SSE line and extracts the data payload.
Returns {:ok, data} if data is found, :done if stream end signal, or :ignore.
@spec reduce_chunks(Enumerable.t()) :: String.t()
Accumulates streamed chunks into a single content string. Useful for non-streaming consumers or testing.