跳到主要内容
非官方简体中文翻译,内容版权归 Mastra 所有,遵循 Apache-2.0 许可。

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 example
Usage 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)

Parameters
Parameters的直接链接

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.

Returns
Returns的直接链接

result:

Promise<Experiment>
The updated experiment record. See dataset.listExperiments() for the full shape.
On this page