Decides if a failed provider attempt can be replayed on another deployment.
Safe failures prove that the upstream did not accept work. Uncertain failures can have billable or side-effecting work in progress. Forbidden failures are request or authorization failures that another deployment must not replay.
Summary
Types
@type decision() :: {:retry | :stop, atom()}
@type policy() :: :safe_only | :allow_uncertain
Functions
@spec decide(LLMProxy.Providers.Result.t(), boolean(), boolean(), policy()) :: decision()