pub struct LlmJudgeMetric<M, T>where
M: CompletionModel,
T: Judgment + Send + Sync + JsonSchema + Serialize + for<'a> Deserialize<'a>,{ /* private fields */ }Available on crate feature
experimental only.Expand description
An LLM as a judge that judges an output by a given schema (and outputs the schema).
The schema type uses the Judgment trait, which simply enforces a single function that checks whether it passes or not.
Trait Implementations§
Source§impl<M, T> Eval<T> for LlmJudgeMetric<M, T>where
M: CompletionModel + 'static,
T: Judgment + Send + Sync + JsonSchema + Serialize + for<'a> Deserialize<'a> + Clone + 'static,
impl<M, T> Eval<T> for LlmJudgeMetric<M, T>where
M: CompletionModel + 'static,
T: Judgment + Send + Sync + JsonSchema + Serialize + for<'a> Deserialize<'a> + Clone + 'static,
async fn eval(&self, input: String) -> EvalOutcome<T>
Source§fn eval_batch(
&self,
input: Vec<String>,
concurrency_limit: usize,
) -> impl Future<Output = Vec<EvalOutcome<Output>>> + Send
fn eval_batch( &self, input: Vec<String>, concurrency_limit: usize, ) -> impl Future<Output = Vec<EvalOutcome<Output>>> + Send
Send a bunch of inputs to be evaluated all in one call.
You can set the concurrency limit to help alleviate issues
with model provider API limits, as sending requests too quickly may
result in throttling or temporary request refusal.
Auto Trait Implementations§
impl<M, T> Freeze for LlmJudgeMetric<M, T>
impl<M, T> !RefUnwindSafe for LlmJudgeMetric<M, T>
impl<M, T> Send for LlmJudgeMetric<M, T>
impl<M, T> Sync for LlmJudgeMetric<M, T>
impl<M, T> Unpin for LlmJudgeMetric<M, T>where
T: Unpin,
impl<M, T> !UnwindSafe for LlmJudgeMetric<M, T>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more