Skip to main content
Agent as Judge evaluations let you define custom quality criteria and use an LLM to score your Agent’s responses. You provide evaluation criteria (like “professional tone”, “factual accuracy”, or “user-friendliness”), and an evaluator model assesses how well the Agent’s output meets those standards.

Basic Example

In this example, the AgentAsJudgeEval will evaluate the output of the Agent with their input, providing a score of the Agent’s response according to the custom criteria provided.
agent_as_judge.py

Custom Evaluator Agent

You can use a custom agent to evaluate responses with specific instructions:
agent_as_judge_custom_evaluator.py

Params

Methods

run() / arun()

Run the evaluation synchronously (run()) or asynchronously (arun()).
Provide either (input, output) for single evaluation OR cases for batch evaluation, not both.

Examples

Basic Agent as Judge

Basic usage with numeric scoring and failure callbacks

Agent as Judge as Post-Hook

Automatic evaluation after agent runs

Developer Resources