Skip to content
Français

FallbackAgent

import type { FallbackAgent } from "@elie-laloum/outpost";
  • kindRequired
    "fallback"
    Discriminator: fallback, for an ordered list of candidates rather than a single agent.
  • agentsRequired
    readonly Agent[]
    Frozen copy of the candidates, in the order they are tried; at least two, none of them a fallback agent.
  • onRequired
    readonly FallbackTrigger[]
    Frozen copy of the failure categories that move to the next candidate; every other failure is rethrown.
export interface FallbackAgent {
  readonly kind: "fallback";
  /** Candidates in the order they are tried. */
  readonly agents: readonly Agent[];
  readonly on: readonly FallbackTrigger[];
}