pub struct E;Expand description
The E namespace — static factory methods for evaluation criteria.
Implementations§
Source§impl E
impl E
Sourcepub fn response_match() -> ECriterion
pub fn response_match() -> ECriterion
Exact response match criterion.
Sourcepub fn contains_match() -> ECriterion
pub fn contains_match() -> ECriterion
Substring containment criterion — scores 1.0 if output contains expected.
Sourcepub fn safety(llm: Arc<dyn BaseLlm>) -> ECriterion
pub fn safety(llm: Arc<dyn BaseLlm>) -> ECriterion
Safety criterion — LLM judge; scores 1.0 when the output is safe.
Mirrors ADK’s safety evaluation, run locally against the judge llm.
Sourcepub fn semantic_match(llm: Arc<dyn BaseLlm>) -> ECriterion
pub fn semantic_match(llm: Arc<dyn BaseLlm>) -> ECriterion
Semantic match criterion — LLM judge comparing the output to the expected
reference answer; scores 1.0 when they convey the same answer.
Mirrors ADK’s final_response_match_v2 (LLM-as-judge with a reference).
Sourcepub fn hallucination(llm: Arc<dyn BaseLlm>) -> ECriterion
pub fn hallucination(llm: Arc<dyn BaseLlm>) -> ECriterion
Hallucination criterion — LLM judge; scores 1.0 when the output is free
of fabricated claims relative to the expected reference.
Sourcepub fn trajectory() -> ECriterion
pub fn trajectory() -> ECriterion
Tool-trajectory criterion (EXACT match) — mirrors ADK’s
TrajectoryEvaluator. Both output and expected are parsed as tool-call
sequences (a JSON array of names/objects, or a comma-separated list), so an
eval harness can score the agent’s captured tool calls against an expected
sequence. Scores 1.0 on an exact match, else 0.0.
Sourcepub fn trajectory_in_order() -> ECriterion
pub fn trajectory_in_order() -> ECriterion
Tool-trajectory criterion requiring the expected calls in order
(extras allowed in between) — ADK’s IN_ORDER mode.
Sourcepub fn trajectory_any_order() -> ECriterion
pub fn trajectory_any_order() -> ECriterion
Tool-trajectory criterion requiring the expected calls in any order
(extras allowed) — ADK’s ANY_ORDER mode.
Sourcepub fn custom(
name: &'static str,
f: impl Fn(&str, &str) -> f64 + Send + Sync + 'static,
) -> ECriterion
pub fn custom( name: &'static str, f: impl Fn(&str, &str) -> f64 + Send + Sync + 'static, ) -> ECriterion
Custom evaluation criterion from a scoring function.
Sourcepub fn from_file(path: &str) -> EvalSuite
pub fn from_file(path: &str) -> EvalSuite
Load eval cases from a file path.
The file should contain one case per pair of consecutive lines:
odd lines are prompts, even lines are expected responses.
Lines starting with # are comments and blank lines are skipped.
Sourcepub fn persona(name: &'static str, description: &'static str) -> ECriterion
pub fn persona(name: &'static str, description: &'static str) -> ECriterion
Create a persona-based evaluator for user simulation.
The persona describes a simulated user with a given name and description, which can be used to generate realistic test interactions.