getClassifierById()
The getClassifierById() method retrieves a classifier by searching for its id property, then falls back to the registration key.
Usage exampleUsage example的直接链接
import { mastra } from './mastra'
const safety = mastra.getClassifierById('safety')
ParametersParameters的直接链接
id:
string
The id property of the classifier to retrieve, or its registration key.
ReturnsReturns的直接链接
classifier:
Classifier
The Classifier instance with the matching id or key.
Error handlingError handling的直接链接
This method throws a MastraError with id MASTRA_GET_CLASSIFIER_BY_ID_NOT_FOUND if no classifier matches the specified id or key.
RelatedRelated的直接链接
- getClassifier(): Get a classifier by its registration key
- listClassifiers(): Get all registered classifiers