Skip to content
Français

JsonResponseOptions

  • tagRequired
    string
    Tag name without angle brackets: a letter followed by letters, digits, _ or -. Another form fails with code configuration.
  • schemaRequired
    StandardValidator<T> | ((input: unknown) => T | Promise<T>)
    Standard Schema validator, such as Zod or Valibot, or a function that receives the parsed JSON as unknown and returns the typed value. Reported issues or a thrown error reject the answer.
  • repairsOptional
    number | undefined
    Correction turns allowed after an invalid answer, default 0; must be a nonnegative integer. Above 0, the agent must be able to resume its conversation.
export type JsonResponseOptions<T> = {
  tag: string;
  schema: StandardValidator<T> | ((input: unknown) => T | Promise<T>);
  repairs?: number;
};