@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
31 lines • 1.4 kB
TypeScript
import type { Mastra } from '../../mastra/index.js';
import type { ExperimentConfig, ExperimentSummary } from './types.js';
export type { DataItem, ExperimentConfig, ExperimentSummary, ItemWithScores, ItemResult, ScorerResult, StartExperimentConfig, } from './types.js';
export { executeTarget, type Target, type ExecutionResult } from './executor.js';
export { resolveScorers, runScorersForItem } from './scorer.js';
export * from './analytics/index.js';
/**
* Run a dataset experiment against a target with optional scoring.
*
* Executes all items in the dataset concurrently (up to maxConcurrency) against
* the specified target (agent or workflow). Optionally applies scorers to each
* result and persists both results and scores to storage.
*
* @param mastra - Mastra instance for storage and target resolution
* @param config - Experiment configuration
* @returns ExperimentSummary with results and scores
*
* @example
* ```typescript
* const summary = await runExperiment(mastra, {
* datasetId: 'my-dataset',
* targetType: 'agent',
* targetId: 'my-agent',
* scorers: [accuracyScorer, latencyScorer],
* maxConcurrency: 10,
* });
* console.log(`${summary.succeededCount}/${summary.totalItems} succeeded`);
* ```
*/
export declare function runExperiment(mastra: Mastra, config: ExperimentConfig): Promise<ExperimentSummary>;
//# sourceMappingURL=index.d.ts.map