Skip to content
Français

SpeculativeValidation

import type { SpeculativeValidation } from "@elie-laloum/outpost";
  • keyRequired
    string
    Key of the candidate being validated.
  • resultRequired
    SpeculativeOutput<T>
    Dispatch output of the candidate: text, value, commits and usage.
  • sandboxRequired
    Sandbox
    Candidate’s sandbox, still open; it closes after validate returns. Commits made in it during validation become part of the candidate’s commit.
  • signalRequired
    AbortSignal
    Aborts when another candidate wins, a token limit is reached or the race is cancelled; pass it to every command.
export interface SpeculativeValidation<T> {
  readonly key: string;
  readonly result: SpeculativeOutput<T>;
  readonly sandbox: Sandbox;
  readonly signal: AbortSignal;
}