A single chunk request through the runner's budget, with the runner's retry policy.
Every attempt acquires from the Limiter first and releases after. The policy per outcome:
429—release_and_pausein one cast (so waiters cannot slip in between release and pause), then retry. Rate-limit waits never consume the chunk's retry budget: the server asked us to wait, not to give up. A server-providedretry-afteris honored verbatim — an hour-long quota reset is waited out, not retried against; when the header is absent the pause escalates exponentially from one backoff period, capped at 30s. A chunk retries up to:rate_limit_retriestimes after a 429 (default 10); the next 429 past that cap fails the chunk with the rate-limit error — bounded, unlike a budget, only by persistence of the 429s — while still pausing the runner with that final 429's deadline, so giving up never hands siblings a hot slot.5xx/ transport error — jittered exponential backoff, consumes one unit ofchunk_retries; budget exhausted returns the last error.- any other error (4xx, parse-level) — returned immediately; a bad request never gets better by retrying.
Emits [:lang_extract, :chunk, :retry] before each retry with the
attempt number and a compact reason
(:rate_limited | :server_error | :transport_error).
Internal — no stability guarantees; see the README's "Stability" section. Documented because it explains how the library works, not because it is API.
Summary
Functions
@spec infer(GenServer.server(), LangExtract.Client.t(), String.t(), keyword()) :: {:ok, LangExtract.Provider.Response.t()} | {:error, LangExtract.Provider.error()}