> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 데이터 세트 클래스 **추가된 항목:** `@mastra/core@1.4.0` `Dataset` 클래스는 단일 데이터 세트에서 항목 CRUD, 버전 관리, 실험 관리를 수행하는 메서드를 제공합니다. `mastra.datasets.get()` 또는 `mastra.datasets.create()`를 통해 가져올 수 있습니다. ## 사용 예 ### 항목 추가 및 실험 실행 ```typescript import { Mastra } from '@mastra/core' const mastra = new Mastra({/* storage config */}) const dataset = await mastra.datasets.create({ name: 'QA pairs', }) // Add items await dataset.addItems({ items: [ { input: { question: 'What is AI?' }, groundTruth: { answer: 'Artificial Intelligence' } }, { input: { question: 'What is ML?' }, groundTruth: { answer: 'Machine Learning' } }, ], }) // Run an experiment const summary = await dataset.startExperiment({ targetType: 'agent', targetId: 'my-agent', scorers: ['accuracy'], }) console.log(`${summary.succeededCount}/${summary.totalItems} succeeded`) ``` ### 버전 및 기록 관리 ```typescript import { Mastra } from '@mastra/core' const mastra = new Mastra({/* storage config */}) const dataset = await mastra.datasets.get({ id: 'dataset-id' }) // List versions const { versions } = await dataset.listVersions() // List items at a specific version const items = await dataset.listItems({ version: 2 }) // Get item change history const history = await dataset.getItemHistory({ itemId: 'item-id' }) ``` ## 입장 `Dataset`직접 인스턴스화되지 않습니다. 다음을 통해 구입하세요.`DatasetsManager`: ```typescript const dataset = await mastra.datasets.get({ id: 'dataset-id' }) // or const dataset = await mastra.datasets.create({ name: 'My dataset' }) ``` ## 속성 전체 데이터 세트 레코드(이름, 설명, 스키마, 버전, 타임스탬프)를 보려면 다음을 호출하세요.[`dataset.getDetails()`](https://mastra.zisheng.pro/ko/reference/datasets/getDetails). **id** (`string`): 데이터 세트의 고유 식별자입니다. 읽기 전용입니다. ## 관련된 - [DatasetsManager 클래스](https://mastra.zisheng.pro/ko/reference/datasets/datasets-manager) - [데이터세트.시작실험()](https://mastra.zisheng.pro/ko/reference/datasets/startExperiment) - [데이터세트.추가항목()](https://mastra.zisheng.pro/ko/reference/datasets/addItems) - [데이터 세트.listVersions()](https://mastra.zisheng.pro/ko/reference/datasets/listVersions)