protocol ¶
JSON WebSocket protocol schemas for the streaming server.
Every control message shares the envelope {"type": <str>, ...}. Pydantic models live here so the server can parse / validate incoming frames and emit well-typed outgoing frames without hand-rolled dicts.
The message catalogue matches the contract in docs/design/server_contracts/streaming.md; additions must land in both places in the same PR.
Classes¶
fastvideo.entrypoints.streaming.protocol.ContinuationStateSnapshot ¶
fastvideo.entrypoints.streaming.protocol.MediaInit ¶
Bases: BaseModel
Descriptor for the fMP4 initialization segment that follows.
fastvideo.entrypoints.streaming.protocol.SegmentPromptSource ¶
Bases: BaseModel
Request a new segment using a specific prompt.
fastvideo.entrypoints.streaming.protocol.SessionInitV2 ¶
Bases: BaseModel
Opening frame the client sends after the WebSocket handshake.
fastvideo.entrypoints.streaming.protocol.SnapshotState ¶
Bases: BaseModel
Request the current ContinuationState for export.
Functions:¶
fastvideo.entrypoints.streaming.protocol.parse_client_message ¶
Parse an incoming WebSocket dict into a typed client message.
Unknown type values raise :class:pydantic.ValidationError; the server handler turns that into an error frame with code="invalid_message".