ReqLLM.Streaming.Retry (ReqLLM v1.12.0)

View Source

Retry wrapper for Finch streaming requests.

Streaming retries are intentionally conservative: only transient transport failures that happen before any response body data is emitted are retried. This avoids duplicating partial model output when a stream has already begun.

Also handles 429 rate limit errors with retry-after header support.

Summary

Types

callback()

@type callback() :: (term(), callback_acc() -> callback_acc())

callback_acc()

@type callback_acc() :: term()

stream_fun()

@type stream_fun() :: (Finch.Request.t(),
                 atom(),
                 term(),
                 (term(), term() -> term()),
                 keyword() ->
                   {:ok, term()} | {:error, term(), term()})

Functions

stream(request, finch_name, acc, callback, opts, stream_fun \\ &Finch.stream/5)

@spec stream(
  Finch.Request.t(),
  atom(),
  callback_acc(),
  callback(),
  keyword(),
  stream_fun()
) :: {:ok, callback_acc()} | {:error, term(), callback_acc()}