Agent.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 exampleDirect link to Usage example
await agent.getScorers();
ParametersDirect link to Parameters
options?:
{ runtimeContext?: RuntimeContext }
= {}
Optional configuration object containing runtime context.
ReturnsDirect link to 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.
Extended usage exampleDirect link to Extended usage example
await agent.getScorers({
runtimeContext: new RuntimeContext(),
});
Options parametersDirect link to Options parameters
runtimeContext?:
RuntimeContext
= new RuntimeContext()
Runtime context for dependency injection and contextual information.