Score a run
Ask, then mark
Pass an agent and the question. The judge runs the agent, then scores what it returned.
input is the question. expected is the answer you want.
Example
from praisonai import Agent
from praisonaiagents.eval import Judge
agent = Agent(instructions="Answer with a number only.")
result = Judge().run(
agent=agent,
input="What is 2+2?",
expected="4",
)
print("Score:", result.score)
print("Passed:", result.passed)Example explained
- agent — The agent the judge will run.
- input — The question sent to that agent.
Reference: documentation