UNPKG

@mastra/core

Version:

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

29 lines (18 loc) 1.04 kB
# listScorers() The `listScorers()` method returns all scorers that have been registered with the Mastra instance. Scorers are used for evaluating AI outputs and can override default scorers during agent generation or workflow execution. ## Usage example ```typescript import { mastra } from './mastra' // Get all registered scorers const allScorers = mastra.listScorers() // Access a specific scorer const myScorer = allScorers.relevancyScorer ``` ## Parameters This method takes no parameters. ## Returns **scorers** (`Record<string, MastraScorer> | undefined`): An object containing all registered scorers, where keys are scorer names and values are MastraScorer instances. Returns undefined if no scorers are registered. ## Related - [getScorer()](https://mastra.ai/reference/core/getScorer): Get a specific scorer by key - [getScorerById()](https://mastra.ai/reference/core/getScorerById): Get a scorer by its id property - [Scorers Overview](https://mastra.ai/docs/evals/overview): Learn about creating and using scorers