Module parser

Module parser 

Source
Expand description

Parser for OpenAI-compatible SSE data: frames.

Isolated so the frame-parsing logic and its tests are self-contained and do not require an HTTP client or async runtime.

§Frame ordering for reasoning models

When a single SSE frame carries both reasoning_content (chain-of-thought) and content (answer text), the ReasoningDelta event is emitted first. This matches the temporal semantics of reasoning models such as DeepSeek R1 and QwQ, where the chain-of-thought is always produced before the answer — even if llama-server coalesces both into the same frame.

Enums§

SseParseResult
Result of parsing a single SSE data: payload.

Functions§

parse_sse_frame
Parse a single SSE data: payload into zero or more LlmStreamEvents.