pub struct LLMAsJudge<M: BaseChatModel> { /* private fields */ }Expand description
LLM 裁判评测器:让 LLM 按评分标准对预测打分(0 到 max_score)。
Implementations§
Source§impl<M: BaseChatModel> LLMAsJudge<M>
impl<M: BaseChatModel> LLMAsJudge<M>
Sourcepub fn with_rubric(self, rubric: impl Into<String>) -> Self
pub fn with_rubric(self, rubric: impl Into<String>) -> Self
设置自定义评分标准(builder 风格)。
Sourcepub fn with_max_score(self, max_score: u8) -> Self
pub fn with_max_score(self, max_score: u8) -> Self
设置最高分(最小为 1)。
Trait Implementations§
Source§impl<M: BaseChatModel> Evaluator for LLMAsJudge<M>
impl<M: BaseChatModel> Evaluator for LLMAsJudge<M>
Source§fn eval<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
input: &'life1 str,
prediction: &'life2 str,
reference: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Score, EvalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn eval<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
input: &'life1 str,
prediction: &'life2 str,
reference: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Score, EvalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
对单条预测打分
Auto Trait Implementations§
impl<M> Freeze for LLMAsJudge<M>where
M: Freeze,
impl<M> RefUnwindSafe for LLMAsJudge<M>where
M: RefUnwindSafe,
impl<M> Send for LLMAsJudge<M>
impl<M> Sync for LLMAsJudge<M>
impl<M> Unpin for LLMAsJudge<M>where
M: Unpin,
impl<M> UnsafeUnpin for LLMAsJudge<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for LLMAsJudge<M>where
M: UnwindSafe,
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