dataset.updateExperiment()
Added in: @mastra/core@1.64.0
Updates the name, description, or metadata of an existing experiment (run). Status and result counters are managed by the experiment lifecycle and can't be changed here.
Usage exampleUsage example的直接链接
import { Mastra } from '@mastra/core'
const mastra = new Mastra({/* storage config */})
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
const experiment = await dataset.updateExperiment({
experimentId: 'exp-id',
name: 'Baseline vs. new prompt',
description: 'Run after switching to the shorter system prompt',
})
console.log(experiment.name)
ParametersParameters的直接链接
experimentId:
string
ID of the experiment to update. Must belong to this dataset.
name?:
string
New display name for the experiment.
description?:
string
New description for the experiment.
metadata?:
Record<string, unknown>
Replacement metadata for the experiment.
Omitted fields are left unchanged.
ReturnsReturns的直接链接
result:
Promise<Experiment>
The updated experiment record. See dataset.listExperiments() for the full shape.