pub struct EvaluationCriteria {
pub tool_trajectory_score: Option<f64>,
pub tool_trajectory_config: Option<ToolTrajectoryConfig>,
pub response_similarity: Option<f64>,
pub response_match_config: Option<ResponseMatchConfig>,
pub semantic_match_score: Option<f64>,
pub semantic_match_config: Option<SemanticMatchConfig>,
pub rubric_quality_score: Option<f64>,
pub rubric_config: Option<RubricConfig>,
pub safety_score: Option<f64>,
pub hallucination_score: Option<f64>,
pub custom: Vec<CustomCriterion>,
}eval only.Expand description
Collection of evaluation criteria
Fields§
§tool_trajectory_score: Option<f64>Tool trajectory matching score threshold (0.0 - 1.0) Checks if the agent called the expected tools in the expected order
tool_trajectory_config: Option<ToolTrajectoryConfig>Tool trajectory configuration
response_similarity: Option<f64>Response text similarity threshold (0.0 - 1.0) Uses text similarity metrics to compare expected vs actual response
response_match_config: Option<ResponseMatchConfig>Response matching configuration
semantic_match_score: Option<f64>LLM-judged semantic match threshold (0.0 - 1.0) Uses an LLM to judge if responses are semantically equivalent
semantic_match_config: Option<SemanticMatchConfig>Semantic match configuration
rubric_quality_score: Option<f64>Rubric-based quality score threshold (0.0 - 1.0) Evaluates response quality against defined rubrics
rubric_config: Option<RubricConfig>Rubric configuration
safety_score: Option<f64>Safety score threshold (0.0 - 1.0) Checks for unsafe or harmful content
hallucination_score: Option<f64>Hallucination detection threshold (0.0 - 1.0) Detects factual inaccuracies or made-up information
custom: Vec<CustomCriterion>Custom criteria for extensibility
Implementations§
Source§impl EvaluationCriteria
impl EvaluationCriteria
Sourcepub fn exact_tools() -> EvaluationCriteria
pub fn exact_tools() -> EvaluationCriteria
Create criteria requiring exact tool trajectory match
Sourcepub fn semantic_match(threshold: f64) -> EvaluationCriteria
pub fn semantic_match(threshold: f64) -> EvaluationCriteria
Create criteria for semantic response matching
Sourcepub fn response_similarity(threshold: f64) -> EvaluationCriteria
pub fn response_similarity(threshold: f64) -> EvaluationCriteria
Create criteria with response similarity
Sourcepub fn with_tool_trajectory(self, threshold: f64) -> EvaluationCriteria
pub fn with_tool_trajectory(self, threshold: f64) -> EvaluationCriteria
Add tool trajectory requirement
Sourcepub fn with_response_similarity(self, threshold: f64) -> EvaluationCriteria
pub fn with_response_similarity(self, threshold: f64) -> EvaluationCriteria
Add response similarity requirement
Sourcepub fn with_semantic_match(self, threshold: f64) -> EvaluationCriteria
pub fn with_semantic_match(self, threshold: f64) -> EvaluationCriteria
Add semantic match requirement
Sourcepub fn with_rubrics(
self,
threshold: f64,
rubrics: Vec<Rubric>,
) -> EvaluationCriteria
pub fn with_rubrics( self, threshold: f64, rubrics: Vec<Rubric>, ) -> EvaluationCriteria
Add rubric-based evaluation
Sourcepub fn has_criteria(&self) -> bool
pub fn has_criteria(&self) -> bool
Check if any criteria are defined
Trait Implementations§
Source§impl Clone for EvaluationCriteria
impl Clone for EvaluationCriteria
Source§fn clone(&self) -> EvaluationCriteria
fn clone(&self) -> EvaluationCriteria
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EvaluationCriteria
impl Debug for EvaluationCriteria
Source§impl Default for EvaluationCriteria
impl Default for EvaluationCriteria
Source§fn default() -> EvaluationCriteria
fn default() -> EvaluationCriteria
Source§impl<'de> Deserialize<'de> for EvaluationCriteria
impl<'de> Deserialize<'de> for EvaluationCriteria
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EvaluationCriteria, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EvaluationCriteria, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for EvaluationCriteria
impl Serialize for EvaluationCriteria
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,
Auto Trait Implementations§
impl Freeze for EvaluationCriteria
impl RefUnwindSafe for EvaluationCriteria
impl Send for EvaluationCriteria
impl Sync for EvaluationCriteria
impl Unpin for EvaluationCriteria
impl UnsafeUnpin for EvaluationCriteria
impl UnwindSafe for EvaluationCriteria
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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>
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>
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>
T in a tonic::Request