Splits a JSON Lines byte stream into complete lines — the format the Message Batches API uses for results.
Pure and incremental, like Claudex.Stream.SSE: feed it whatever bytes
arrived, get back the lines those bytes completed and a decoder holding the
rest. Turning a line into JSON is the caller's job, so a malformed line can
be reported with its contents instead of surfacing as a decode error from
somewhere deeper.
Summary
Functions
Feeds chunk to the decoder, returning the lines it completed and a decoder
holding the partial line at the end. Blank lines are dropped.
Drains the buffer, returning a final line that arrived without a trailing newline.
Builds a decoder with an empty buffer.
Types
@type t() :: %Claudex.JSONL{buffer: binary()}
Functions
Feeds chunk to the decoder, returning the lines it completed and a decoder
holding the partial line at the end. Blank lines are dropped.
Drains the buffer, returning a final line that arrived without a trailing newline.
@spec new() :: t()
Builds a decoder with an empty buffer.