Package com.tnsai.coordination.debate
Class PeerReviewExecutor
java.lang.Object
com.tnsai.coordination.debate.PeerReviewExecutor
Peer review executor where one agent produces and another reviews iteratively.
Agent A produces output, Agent B reviews it and suggests improvements, Agent A incorporates feedback and produces a revised version. This repeats until the reviewer is satisfied or max iterations reached.
Usage
PeerReviewExecutor review = PeerReviewExecutor.builder()
.producer(producerLLM)
.reviewer(reviewerLLM)
.maxIterations(3)
.build();
PeerReviewResult result = review.execute("Write a REST API design document");
System.out.println(result.finalOutput());
System.out.println("Iterations: " + result.iterationsUsed());
- Since:
- 0.0.5
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for PeerReviewExecutor.static final recordA single iteration of peer review.static final recordResult of the peer review process. -
Method Summary
Modifier and TypeMethodDescriptionstatic PeerReviewExecutor.Builderbuilder()Executes the peer review process.
-
Method Details
-
execute
Executes the peer review process.- Parameters:
task- the task description- Returns:
- the review result with final output and iteration history
-
builder
-