Skip to main content

EvaluationResultsQuery

The query object passed to EvaluationResultsClient.list() and Adaline.initEvaluationResults(). Combines identifiers, filters, and pagination in a single shape so that polling helpers can replay the same query on every refresh.

Definition

interface EvaluationResultsQuery {
  promptId: string;
  evaluationId: string;
  grade?: 'pass' | 'fail' | 'unknown';
  expand?: 'row';
  sort?: 'createdAt:asc' | 'createdAt:desc' | 'score:asc' | 'score:desc';
  limit?: number;
  cursor?: string;
}

Fields

FieldTypeDescription
promptIdstringPrompt the evaluation belongs to. Required.
evaluationIdstringEvaluation whose results you want. Required.
grade'pass' | 'fail' | 'unknown'Only return rows with this grade.
expand'row'If "row", each result includes its underlying dataset row.
sort'createdAt:asc' | 'createdAt:desc' | 'score:asc' | 'score:desc'Sort order.
limitnumberPage size.
cursorstringOpaque cursor returned by the previous response’s pagination.nextCursor.

Usage

import type { EvaluationResultsQuery } from '@adaline/client';

const query: EvaluationResultsQuery = {
  promptId: 'prompt_abc123',
  evaluationId: 'eval_abc123',
  grade: 'fail',
  expand: 'row',
  sort: 'score:desc',
  limit: 50,
};

// One-shot fetch
const page = await adaline.prompts.evaluations.results.list(query);

// Or keep a polling cache refreshed in the background
const results = await adaline.initEvaluationResults({
  query,
  refreshInterval: 30,
});

See Also