pub struct TokenEfficientEvaluation;Expand description
Selects the branch with the lowest total token usage.
Prefer this strategy when cost or latency is the primary concern and you want the most concise result that still answers the question.
Trait Implementations§
Source§impl EvaluationStrategy for TokenEfficientEvaluation
impl EvaluationStrategy for TokenEfficientEvaluation
Source§fn evaluate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_prompts: &'life1 [AgentMessage],
outcomes: &'life2 [ParallelLoopOutcome],
_tx: &'life3 UnboundedSender<AgentEvent>,
_cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = (EvaluationDecision, Usage)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn evaluate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_prompts: &'life1 [AgentMessage],
outcomes: &'life2 [ParallelLoopOutcome],
_tx: &'life3 UnboundedSender<AgentEvent>,
_cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = (EvaluationDecision, Usage)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Evaluate all branch outcomes and select the best one.
Auto Trait Implementations§
impl Freeze for TokenEfficientEvaluation
impl RefUnwindSafe for TokenEfficientEvaluation
impl Send for TokenEfficientEvaluation
impl Sync for TokenEfficientEvaluation
impl Unpin for TokenEfficientEvaluation
impl UnsafeUnpin for TokenEfficientEvaluation
impl UnwindSafe for TokenEfficientEvaluation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more