AgentAsJudgeEval grades an input/output pair against custom criteria with an LLM judge. Score recorded outputs directly with run(), or attach the eval as a post_hook to grade live runs.
Parameters
Methods
run() and arun()
Both accept the same keyword arguments and return Optional[AgentAsJudgeResult]. Provide either input and output for a single evaluation, or cases for batch evaluation. run() raises with an async database; use arun() instead.
Hook methods
AgentAsJudgeEval extends BaseEval, so an instance can be passed directly to an Agent’s or Team’s post_hooks. The post_check() and async_post_check() methods grade the run’s input and output and log the result to db with the agent or team ID attached. Pre-hooks are not supported and raise ValueError.
AgentAsJudgeResult
AgentAsJudgeResult also exposes print_summary(console=None) and print_results(console=None).
AgentAsJudgeEvaluation
Each entry inAgentAsJudgeResult.results is an AgentAsJudgeEvaluation: