メインコンテンツへ移動

listScorers()

listScorers() メソッドは、Mastra インスタンスに登録されているすべての Scorer を返します。Scorer は AI の出力を評価するために使用され、Agent の生成時や Workflow の実行時にデフォルトの Scorer を上書きできます。

使用例
使用例への直接リンク

import { mastra } from './mastra'

// Get all registered scorers
const allScorers = mastra.listScorers()

// Access a specific scorer
const myScorer = allScorers.relevancyScorer

パラメーター
パラメーターへの直接リンク

このメソッドはパラメーターを受け取りません。

戻り値
戻り値への直接リンク

scorers:

Record<string, MastraScorer> | undefined
登録済みのすべての Scorer を含むオブジェクト。キーは Scorer 名、値は MastraScorer インスタンスです。Scorer が登録されていない場合は undefined を返します。