pub struct ParallelEvaluator { /* private fields */ }
Expand description
Evaluator for running multiple LLM providers in parallel and selecting the best response
Implementations§
Source§impl ParallelEvaluator
impl ParallelEvaluator
Sourcepub fn scoring<F>(self, f: F) -> Self
pub fn scoring<F>(self, f: F) -> Self
Adds a scoring function to evaluate LLM responses
§Arguments
f
- Function that takes a response string and returns a score
Sourcepub fn include_timing(self, include: bool) -> Self
pub fn include_timing(self, include: bool) -> Self
Sets whether to include timing information in results
Sourcepub async fn evaluate_chat_parallel(
&self,
messages: &[ChatMessage],
) -> Result<Vec<ParallelEvalResult>, LLMError>
pub async fn evaluate_chat_parallel( &self, messages: &[ChatMessage], ) -> Result<Vec<ParallelEvalResult>, LLMError>
Sourcepub async fn evaluate_chat_with_tools_parallel(
&self,
messages: &[ChatMessage],
tools: Option<&[Tool]>,
) -> Result<Vec<ParallelEvalResult>, LLMError>
pub async fn evaluate_chat_with_tools_parallel( &self, messages: &[ChatMessage], tools: Option<&[Tool]>, ) -> Result<Vec<ParallelEvalResult>, LLMError>
Sourcepub async fn evaluate_completion_parallel(
&self,
request: &CompletionRequest,
) -> Result<Vec<ParallelEvalResult>, LLMError>
pub async fn evaluate_completion_parallel( &self, request: &CompletionRequest, ) -> Result<Vec<ParallelEvalResult>, LLMError>
Sourcepub fn best_response<'a>(
&self,
results: &'a [ParallelEvalResult],
) -> Option<&'a ParallelEvalResult>
pub fn best_response<'a>( &self, results: &'a [ParallelEvalResult], ) -> Option<&'a ParallelEvalResult>
Auto Trait Implementations§
impl Freeze for ParallelEvaluator
impl !RefUnwindSafe for ParallelEvaluator
impl Send for ParallelEvaluator
impl Sync for ParallelEvaluator
impl Unpin for ParallelEvaluator
impl !UnwindSafe for ParallelEvaluator
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