Turn a Req asynchronous response into a lazy Stream of Server-Sent-Events.
Req streams the body into the calling process mailbox when into: :self is
used; this module wraps that into an idiomatic Elixir stream. Each emitted
item is either:
- a decoded JSON
map(the payload of adata:frame), {:error, reason}, or:done— emitted once as the very last item, signalling end-of-stream.
Used by the OpenAI and Anthropic adapters' request_stream/4.
Summary
Functions
@spec stream( Req.Response.t(), keyword() ) :: Enumerable.t()