Package com.tnsai.coordination.judge
Class LLMJudgePolicy
java.lang.Object
com.tnsai.coordination.judge.LLMJudgePolicy
- All Implemented Interfaces:
JudgePolicy
A
JudgePolicy that uses an LLM to evaluate coordination output.
The LLM receives the output along with configurable evaluation criteria and produces a structured verdict. This enables natural-language quality assessment for complex, subjective criteria.
Usage
LLMClient judge = new OpenAIClient("gpt-4o", apiKey);
JudgePolicy policy = LLMJudgePolicy.builder()
.llmClient(judge)
.criteria("Evaluate for correctness, completeness, and clarity. " +
"Score 0.8+ means production-ready.")
.build();
- Since:
- 0.2.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for LLMJudgePolicy. -
Method Summary
Modifier and TypeMethodDescriptionstatic LLMJudgePolicy.Builderbuilder()evaluate(String agentId, Object output, JudgeContext context) Evaluates an agent's output and produces a verdict.
-
Method Details
-
evaluate
Description copied from interface:JudgePolicyEvaluates an agent's output and produces a verdict.- Specified by:
evaluatein interfaceJudgePolicy- Parameters:
agentId- the identifier of the agent whose output is being judgedoutput- the output to evaluate (type depends on coordination pattern)context- iteration state and history- Returns:
- a verdict with decision, score, and optional feedback
-
builder
-