Expand description
Decode-then-validate classification for JSON stream wire frames.
Each streaming wire family classifies every frame through exactly one of
the functions below before acting on it, so the parse policy is stated once
per family instead of being re-derived from serde failure modes at each
call site. The classification is a hand-written tag dispatch, never an
untagged serde fallback: a trailing #[serde(untagged)] variant on an
internally-tagged enum swallows a known tag with an invalid payload
(rig-2257-code-review-findings-34ee8ba5.md P2), which would silently
demote a data-level defect to an ignorable unknown event.
Enums§
- Typed
Event - Triage of one already-deserialized event from a typed-transport wire
(an aws-sdk event stream, a prost/tonic gRPC stream, an in-process
generation channel), for
classify_typed_event. - Wire
Event - One classified wire frame.
Functions§
- classify_
chat_ completions_ frame - Classify one chat-completions SSE frame (OpenAI-compatible chat wire).
- classify_
marker_ keyed_ frame - Classify one frame of an untagged JSON wire recognized by payload keys
(Gemini
streamGenerateContent). - classify_
tagged_ frame - Classify one frame of a tag-discriminated JSON wire (OpenAI Responses SSE,
Cohere SSE, and Anthropic use
type; Gemini Interactions usesevent_type). - classify_
typed_ event - Classify one event of a typed-transport wire (bedrock’s Converse event stream, gemini-grpc, candle’s in-process generation).
- classify_
untyped_ line - Classify one line of an undiscriminated NDJSON wire (Ollama).
- classify_
with_ repair - Classify a frame with a one-shot salvage step for
Corruptresults.