UNPKG

@mastra/core

Version:

Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.

31 lines (19 loc) 623 B
# DatasetsManager.get() **Added in:** `@mastra/core@1.4.0` Retrieves an existing dataset by ID. Throws a `MastraError` if the dataset doesn't exist. ## Usage example ```typescript import { Mastra } from '@mastra/core' const mastra = new Mastra({ /* storage config */ }) const dataset = await mastra.datasets.get({ id: 'dataset-id' }) // Now use the dataset const details = await dataset.getDetails() console.log(details.name) ``` ## Parameters **id** (`string`): Unique identifier of the dataset. ## Returns Throws `MastraError` if the dataset isn't found. **result** (`Promise<Dataset>`): A Dataset instance.