getScorers()
The .getScorers()
method retrieves the scoring configuration configured for an agent, resolving it if it’s a function. This method provides access to the scoring system used for evaluating agent responses and performance.
Usage example
const scorers = await agent.getScorers();
Parameters
options?:
{ runtimeContext?: RuntimeContext }
= {}
Optional configuration object containing runtime context.
Extended usage example
const scorers = await agent.getScorers({
runtimeContext: new RuntimeContext()
});
Options parameters
runtimeContext?:
RuntimeContext
= new RuntimeContext()
Runtime context for dependency injection and contextual information.
Returns
scorers:
MastraScorers | Promise<MastraScorers>
The scoring configuration configured for the agent, either as a direct object or a promise that resolves to the scorers.