Skip to content
Français

SpeculativeValidation

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