Buble.SSE (buble v0.1.0)

Copy Markdown View Source

Server-sent event parser and text extraction helpers.

Summary

Functions

events(body)

@spec events(binary()) :: Enumerable.t()

events_from_chunks(chunks)

@spec events_from_chunks(Enumerable.t()) :: Enumerable.t()

parse_lines(lines)

@spec parse_lines(Enumerable.t()) :: Enumerable.t()

text_from_event(event, protocol)

@spec text_from_event(Buble.SSE.Event.t(), :openai | :anthropic | :gemini) ::
  {:ok, String.t()} | {:error, Buble.Error.t()}

text_stream(events, protocol)

@spec text_stream(Enumerable.t(), :openai | :anthropic | :gemini) :: Enumerable.t()