pub struct Rubric {
pub version: String,
pub goal_text: Option<String>,
pub criteria: Vec<Criterion>,
pub aggregation: String,
pub metadata: HashMap<String, Value>,
}Expand description
A rubric containing multiple evaluation criteria.
Fields§
§version: StringVersion identifier for this rubric.
goal_text: Option<String>High-level goal or purpose of the evaluation.
criteria: Vec<Criterion>List of criteria to evaluate.
aggregation: StringHow to aggregate criterion scores.
metadata: HashMap<String, Value>Optional metadata.
Implementations§
Source§impl Rubric
impl Rubric
Sourcepub fn with_criterion(self, criterion: Criterion) -> Rubric
pub fn with_criterion(self, criterion: Criterion) -> Rubric
Add a criterion to this rubric.
Sourcepub fn with_aggregation(self, aggregation: impl Into<String>) -> Rubric
pub fn with_aggregation(self, aggregation: impl Into<String>) -> Rubric
Set the aggregation method.
Sourcepub fn total_weight(&self) -> f64
pub fn total_weight(&self) -> f64
Get total weight of all criteria.
Sourcepub fn get_criterion(&self, id: &str) -> Option<&Criterion>
pub fn get_criterion(&self, id: &str) -> Option<&Criterion>
Get a criterion by ID.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rubric
impl<'de> Deserialize<'de> for Rubric
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rubric, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rubric, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Rubric
impl Serialize for Rubric
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Rubric
impl RefUnwindSafe for Rubric
impl Send for Rubric
impl Sync for Rubric
impl Unpin for Rubric
impl UnwindSafe for Rubric
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request