03 7 min Updated Sep 19, 2026

Run one evaluate call

Send shared state + a map of named questions; read typed answers and confidence in code.

Shape

  1. Build state (string, object, or array per SDK docs).
  2. Declare named questions (Boolean / Choice / Score).
  3. Call evaluate once — fan out, do not ask one question per round-trip by habit.
  4. Read answers + confidence in your code.
  5. Never paste API keys into this site or screenshots in git.

Illustrative Gateway shape (copy from live docs when implementing):

import { experimental_evaluate as evaluate } from "ai";

const result = await evaluate({
  model: "typesafe-ai/jev",
  state: "The support agent issued a full refund to the customer.",
  questions: {
    refunded: {
      type: "boolean",
      instructions: "Was a refund issued?",
    },
  },
});

Next

Threshold confidence, then act or escalate