KyroKyro
API Reference

@kyro/batch

Full API reference for the BatchJudge class and related types.

BatchJudge

new BatchJudge(
  provider: AIProvider,
  configPath: string,
  options?: BatchOptions
)
ParameterTypeDescription
providerAIProviderMust be an OpenAI or Anthropic provider
configPathstringPath to the YAML pipeline config
optionsBatchOptions?Optional configuration
interface BatchOptions {
  stateDir?: string;      // Directory for state files (default: .kyro/)
  webhookUrl?: string;    // Webhook URL for completion notification
}

.submit(transcripts, options?)

Submit a batch of transcripts for evaluation.

async submit(
  transcripts: Array<string | Record<string, unknown>>,
  options?: SubmitOptions
): Promise<BatchJob>
interface SubmitOptions {
  runs?: number;                        // Runs per transcript (default: 1)
  aggregation?: 'majority_vote' | 'any_pass' | 'all_pass';
}
 
interface BatchJob {
  jobId: string;
  submittedAt: Date;
  transcriptCount: number;
  estimatedCompletionMs?: number;
}

.check(jobId?)

Check the status of a batch job.

async check(jobId?: string): Promise<BatchRunResult | null>

Returns null if the job is still in progress. Pass jobId explicitly or use the default from the last submitted job.

BatchRunResult

interface BatchRunResult {
  jobId: string;
  status: 'completed' | 'failed';
  total: number;
  passed: number;
  failed: number;
  completedAt: Date;
  results: Array<{
    transcriptIndex: number;
    status: 'SUCCESS' | 'ERROR';
    data: Record<string, StepResult>;
    aggregatedFrom?: number;  // Number of runs aggregated
  }>;
}

On this page