LLMProxy.Stream.Heartbeat (llm_proxy v0.1.0)

Copy Markdown View Source

Adds periodic heartbeat markers while an upstream enumerable is silent.

The producer is pulled at most one event ahead so slow HTTP clients cannot cause unbounded buffering. Consumers render heartbeat markers as SSE comments.

Summary

Types

t()

@type t() :: %LLMProxy.Stream.Heartbeat{}

Functions

wrap(stream, interval_ms \\ 15000)

@spec wrap(Enumerable.t(), pos_integer()) :: Enumerable.t()