Score the candidate against the rubric and return a populated schema.
Source code in src/agentic_architectures/evaluators/judge.py
| def evaluate(self, candidate: str, context: dict[str, str] | None = None) -> T:
"""Score the candidate against the rubric and return a populated schema."""
ctx_block = ""
if context:
ctx_block = "\n\n### Context\n" + "\n".join(f"- **{k}**: {v}" for k, v in context.items())
prompt = (
f"You are an impartial evaluator.\n\n"
f"### Rubric\n{self.rubric}\n{ctx_block}\n\n"
f"### Candidate\n{candidate}\n\n"
f"Return your evaluation in the requested structured format."
)
result = self._judge_llm.invoke(prompt)
# `with_structured_output` returns the schema instance directly.
return result # type: ignore[return-value]
|