@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
30 lines (18 loc) • 707 B
Markdown
**Added in:** `@mastra/core@1.4.0`
Retrieves a specific experiment (run) by its ID.
## Usage example
```typescript
import { Mastra } from '@mastra/core'
const mastra = new Mastra({
/* storage config */
})
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
const experiment = await dataset.getExperiment({ experimentId: 'exp-id' })
console.log(`Status: ${experiment.status}`)
console.log(`${experiment.succeededCount}/${experiment.totalItems} succeeded`)
```
**experimentId** (`string`): ID of the experiment to retrieve.
**result** (`Promise<Experiment>`): The experiment record. See dataset.listExperiments() for the full shape.