跳到主要内容

Agent.listScorers()

.listScorers() 方法检索为 Agent 配置的评分配置;如果配置是函数,则会先解析该函数。该方法提供对评分系统的访问,用于评估 Agent 的响应和性能。

使用示例
使用示例的直接链接

await agent.listScorers()

参数
参数的直接链接

options?:

{ requestContext?: RequestContext }
= {}
包含 request context 的可选配置对象。
{ requestContext?: RequestContext }

requestContext?:

RequestContext
用于依赖注入和上下文信息的 Request Context。

返回值
返回值的直接链接

scorers:

MastraScorers | Promise<MastraScorers>
为 Agent 配置的评分配置,可以是直接提供的对象,也可以是解析为 scorers 的 Promise。

扩展使用示例
扩展使用示例的直接链接

await agent.listScorers({
requestContext: new RequestContext(),
})