ocaml-ai-sdk.ai_provider
Ai_provider.Sse
Server-Sent Events parser for streaming API responses.
ocaml-ai-sdk.ai_core
ocaml-ai-sdk.ai_provider_anthropic
ocaml-ai-sdk.ai_provider_openai
type event = {
event_type : string;
data : string;
}
val 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.