Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/agent / fallback

fallback

Agent-level model fallback chain primitives.

The agent runtime walks [primaryModel, ...Agent.fallbackModels] on fallback-eligible errors during the per-step provider call. isAgentFallbackEligible(...) is the pure decision function the runtime calls once per ProviderError.

Layering: this module is the agent-step-level fallback (re-tries the whole step against a different model on rate-limit / capacity / context-length / transient errors). The request-level withFallback provider middleware (@graphorin/provider) is a separate concern — it retries against an alternate provider serving the same model concept on transient errors inside one provider.stream(...) call.

Interfaces

InterfaceDescription
AgentFallbackEligibilityOutcome of isAgentFallbackEligible.
AgentFallbackPolicyOperator-supplied policy that lets the consumer toggle which ProviderError kinds the agent runtime should consider eligible for whole-step retries against the next model in the chain.

Type Aliases

Type AliasDescription
AgentFallbackReasonStable taxonomy returned by isAgentFallbackEligible on eligible errors.

Functions

FunctionDescription
isAgentFallbackEligiblePure dispatcher that maps a ProviderError to one of four eligible reasons or to eligible: false if the error is on the bypass list (`auth