Skip to main content

Agent.listScorers()

The .listScorers() 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

await agent.listScorers();

Parameters

options?:

{ runtimeContext?: RuntimeContext }
= {}
Optional configuration object containing request context.

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 example

await agent.listScorers({
runtimeContext: new RuntimeContext(),
});

Options parameters

runtimeContext?:

RuntimeContext
= new RuntimeContext()
Request Context for dependency injection and contextual information.

On this page