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
| Interface | Description |
|---|---|
| AgentFallbackEligibility | Outcome of isAgentFallbackEligible. |
| AgentFallbackPolicy | Operator-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 Alias | Description |
|---|---|
| AgentFallbackReason | Stable taxonomy returned by isAgentFallbackEligible on eligible errors. |
Functions
| Function | Description |
|---|---|
| isAgentFallbackEligible | Pure dispatcher that maps a ProviderError to one of four eligible reasons or to eligible: false if the error is on the bypass list (`auth |