Skip to content

Graphorin API reference v0.12.1


Graphorin API reference / @graphorin/agent / fallback / isAgentFallbackEligible

Function: isAgentFallbackEligible()

ts
function isAgentFallbackEligible(error, policy?): AgentFallbackEligibility;

Defined in: packages/agent/src/fallback/index.ts:77

Pure dispatcher that maps a ProviderError to one of four eligible reasons or to eligible: false if the error is on the bypass list - the ProviderErrorKind values invalid-request, unauthorized, content-filter, and unknown.

The function is intentionally allocation-free on the hot path so the agent runtime can call it once per provider error per step without budget concerns.

Parameters

ParameterType
errorProviderError
policyAgentFallbackPolicy

Returns

AgentFallbackEligibility

Stable