pub struct TaskCompletionEvaluator { /* private fields */ }Expand description
Task completion against a declared assertion
(prompt: task_completion_v0).
Criterion: the case must declare an expected_assertion and the
invocation must have a non-empty final response.
Implementations§
Source§impl TaskCompletionEvaluator
impl TaskCompletionEvaluator
Sourcepub const fn new(config: JudgeEvaluatorConfig) -> Self
pub const fn new(config: JudgeEvaluatorConfig) -> Self
Construct with the supplied judge config.
Sourcepub fn with_prompt(self, template: Arc<dyn JudgePromptTemplate>) -> Self
pub fn with_prompt(self, template: Arc<dyn JudgePromptTemplate>) -> Self
Override the prompt template used by this evaluator.
Sourcepub fn with_few_shot(self, examples: Vec<FewShotExample>) -> Self
pub fn with_few_shot(self, examples: Vec<FewShotExample>) -> Self
Attach evaluator-level few-shot examples that render before any case-level examples.
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Override the system prompt visible to the template render.
Sourcepub fn with_output_schema(self, schema: Value) -> Self
pub fn with_output_schema(self, schema: Value) -> Self
Attach an output schema for custom prompt templates.
Sourcepub fn with_use_reasoning(self, flag: bool) -> Self
pub fn with_use_reasoning(self, flag: bool) -> Self
Toggle judge reasoning capture.
Sourcepub fn with_feedback_key(self, key: impl Into<String>) -> Self
pub fn with_feedback_key(self, key: impl Into<String>) -> Self
Override the feedback key used by downstream exporters.
Sourcepub const fn config(&self) -> &JudgeEvaluatorConfig
pub const fn config(&self) -> &JudgeEvaluatorConfig
Borrow the underlying config (e.g., to inspect the judge registry or feedback key).
Trait Implementations§
Source§impl Evaluator for TaskCompletionEvaluator
impl Evaluator for TaskCompletionEvaluator
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Unique name for this evaluator, used in
EvalCase::evaluators filters.Source§fn evaluate(
&self,
case: &EvalCase,
invocation: &Invocation,
) -> Option<EvalMetricResult>
fn evaluate( &self, case: &EvalCase, invocation: &Invocation, ) -> Option<EvalMetricResult>
Score the actual invocation against the expected case. Read more
Source§impl JudgeEvaluatorBuilder for TaskCompletionEvaluator
impl JudgeEvaluatorBuilder for TaskCompletionEvaluator
Source§fn judge_config_mut(&mut self) -> &mut JudgeEvaluatorConfig
fn judge_config_mut(&mut self) -> &mut JudgeEvaluatorConfig
Borrow the evaluator’s underlying
JudgeEvaluatorConfig for
mutation by the default builder methods.Source§fn with_prompt(self, template: Arc<dyn JudgePromptTemplate>) -> Self
fn with_prompt(self, template: Arc<dyn JudgePromptTemplate>) -> Self
Override the built-in prompt template.
Source§fn with_few_shot(self, examples: Vec<FewShotExample>) -> Self
fn with_few_shot(self, examples: Vec<FewShotExample>) -> Self
Attach few-shot examples.
Source§fn with_system_prompt(self, prompt: impl Into<String>) -> Self
fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Override the system prompt applied ahead of the rendered prompt.
Source§fn with_output_schema(self, schema: Value) -> Self
fn with_output_schema(self, schema: Value) -> Self
Override the output-schema identifier used by structured-output
evaluators.
Source§fn with_use_reasoning(self, flag: bool) -> Self
fn with_use_reasoning(self, flag: bool) -> Self
Toggle the
use_reasoning flag.Source§fn with_feedback_key(self, key: impl Into<String>) -> Self
fn with_feedback_key(self, key: impl Into<String>) -> Self
Override the feedback key forwarded to telemetry / reporter backends.
Source§fn with_aggregator(self, aggregator: Arc<dyn Aggregator>) -> Self
fn with_aggregator(self, aggregator: Arc<dyn Aggregator>) -> Self
Override the aggregator applied to per-sample judge scores.
Auto Trait Implementations§
impl Freeze for TaskCompletionEvaluator
impl !RefUnwindSafe for TaskCompletionEvaluator
impl Send for TaskCompletionEvaluator
impl Sync for TaskCompletionEvaluator
impl Unpin for TaskCompletionEvaluator
impl UnsafeUnpin for TaskCompletionEvaluator
impl !UnwindSafe for TaskCompletionEvaluator
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