> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-TW/llms.txt # DatasetsManager.create() **新增於:** `@mastra/core@1.4.0` 建立新資料集。使用 Standard JSON Schema(Zod、Valibot、ArkType 等)定義 schema。 ## 使用範例 ```typescript import { Mastra } from '@mastra/core' import { z } from 'zod' const mastra = new Mastra({/* storage config */}) // Create with metadata const dataset = await mastra.datasets.create({ name: 'QA evaluation set', description: 'Question-answer pairs for testing', metadata: { team: 'ml' }, }) // Create with Zod schema (library that supports Standard JSON Schema) const typedDataset = await mastra.datasets.create({ name: 'Typed QA set', inputSchema: z.object({ question: z.string(), context: z.string().optional(), }), groundTruthSchema: z.object({ answer: z.string(), }), }) ``` ## 參數 **name** (`string`): 資料集的顯示名稱。 **description** (`string`): 資料集的描述。 **inputSchema** (`StandardJSONSchemaV1`): 項目輸入的 Standard JSON Schema。 **groundTruthSchema** (`StandardJSONSchemaV1`): 項目 ground truth 的 Standard JSON Schema。 **metadata** (`Record`): 任意中繼資料。 ## 傳回值 **result** (`Promise`): 新建立資料集的 Dataset 執行個體。