pub struct JsonRuleScorer { /* private fields */ }Expand description
Weighted deterministic scorer for structured outputs.
Implementations§
Source§impl JsonRuleScorer
impl JsonRuleScorer
Sourcepub fn new(
name: impl Into<String>,
threshold: f64,
rules: Vec<WeightedJsonRule>,
) -> Result<Self, EvaluationError>
pub fn new( name: impl Into<String>, threshold: f64, rules: Vec<WeightedJsonRule>, ) -> Result<Self, EvaluationError>
Creates a non-empty weighted rule scorer.
§Errors
Returns an error for invalid identity, threshold, or no rules.
Trait Implementations§
Source§impl Clone for JsonRuleScorer
impl Clone for JsonRuleScorer
Source§fn clone(&self) -> JsonRuleScorer
fn clone(&self) -> JsonRuleScorer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonRuleScorer
impl Debug for JsonRuleScorer
Source§impl EvaluationScorer for JsonRuleScorer
impl EvaluationScorer for JsonRuleScorer
Source§fn score(
&self,
_case: EvaluationCase,
output: EvaluationOutput,
) -> EvaluationFuture<Result<ScoreValue, EvaluationError>>
fn score( &self, _case: EvaluationCase, output: EvaluationOutput, ) -> EvaluationFuture<Result<ScoreValue, EvaluationError>>
Scores one target output.
Auto Trait Implementations§
impl Freeze for JsonRuleScorer
impl RefUnwindSafe for JsonRuleScorer
impl Send for JsonRuleScorer
impl Sync for JsonRuleScorer
impl Unpin for JsonRuleScorer
impl UnsafeUnpin for JsonRuleScorer
impl UnwindSafe for JsonRuleScorer
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