Skip to main content

Module evaluation

Module evaluation 

Source
Expand description

Pluggable evaluation strategies for agent_loop_parallel.

EvaluationStrategy selects the best result after parallel branches finish. Five built-in implementations cover the most common use cases; implement the trait for custom evaluation logic.

§Built-in strategies

StrategySelection criterionUse case
TransparentEvaluationPass-through (1 branch only)Zero-overhead wrapper
PickFirstEvaluationAlways index 0Testing / deterministic default
TokenEfficientEvaluationLowest total token usageCost / latency priority
ElaborateEvaluationHighest total token usageDepth / thoroughness priority
LlmJudgeEvaluationSeparate LLM judge callBest quality selection

Re-exports§

pub use crate::types::EvaluationDecision;
pub use crate::types::EvaluationStrategy;

Structs§

ElaborateEvaluation
Selects the branch with the highest total token usage.
LlmJudgeEvaluation
Uses a separate LLM call to judge which branch response is best.
PickFirstEvaluation
Always selects the first branch (index 0), regardless of content.
TokenEfficientEvaluation
Selects the branch with the lowest total token usage.
TransparentEvaluation
Single-branch pass-through — panics if more than one branch is present.