Module Ai_provider.SseSource

Server-Sent Events parser for streaming API responses.

Sourcetype event = {
  1. event_type : string;
  2. data : string;
}
Sourceval parse_events : string Lwt_stream.t -> event Lwt_stream.t

Parse a stream of SSE text lines into typed events. Handles multi-line data, event type prefixes, comments, and blank lines.