Metric return values
Native scorer contract
Scorers may be sync or async; use async I/O for network calls. They receive ADK evaluation inputs, not a Harnest runtime or storage client.
Actual and golden invocation counts can differ. Check the index before accessing
expected[index], and handle expected=None for simulations.
Native result contract
A scoredEvaluationResult requires one ordered PerInvocationResult per actual invocation. Entirely NOT_EVALUATED results are exempt.
Keep aggregate and per-turn scores consistent: the CLI gate compares the mean of scored turns with the threshold.
For final-turn scoring, mark earlier rows
NOT_EVALUATED and use the last turn’s score as the overall score. Entirely unscored metrics cannot pass. See the walkthrough for mean-of-turns scoring.
EvalRunResult envelope
The current contract is identified by:apiVersion. The result schema is versioned independently from the installed ADK’s nested case models.
Top-level fields
Case diagnostics
EachevalCaseResults item preserves:
- Overall result, score, criterion, and details for every metric.
- Per-invocation metric results.
- Complete actual invocations and optional expected invocations.
- User content, final responses, intermediate events, tool evidence, and applicable rubrics carried by those invocations.
- Evaluator session ID, user ID, and session details, including state and recorded events.
- Rubric scores and rationales in each metric’s
details.rubricScoreswhen the evaluator supplies them.
not_evaluated means no score; the CLI averages scored turns only.
Infrastructure errors
If evaluation has started and a provider, adapter, or evaluator raises an infrastructure error, Harnest emits or writes the partial result before reporting the original command failure. Its top-level error excerpt looks like this:EvaluationExecutionError means execution or scoring failed without metric results. Follow its safe diagnostic message and inspect the local traceback. Fix runtime problems before reassessing quality.
Judge configuration
Exports
EVAL_TRAJECTORIES
Example
Example
EvalRunnerContext
One runner’s options, agent HTTP client, project inputs, and private report directory.— means no declared default):
Parameters and example
Parameters and example
EvalRunnerResult
A quality verdict and optional report files relative to the runner’s directory.— means no declared default):
Parameters and example
Parameters and example
EvaluationError
An evaluation request cannot be executed with the installed runtime.Example
Example
MetricContext
A case’s native ADK evidence, available to sync and async Harnest scorers.— means no declared default):
Parameters and example
Parameters and example
MetricContext.threshold
Read the authored criterion instead of ADK’s deprecated threshold field.Example
Example
MetricScore
One finite score and optional human-readable evidence; None means unscored.— means no declared default):
Parameters and example
Parameters and example
adk_eval_agent_module
Expose isolated native plugins with managed identity and error reporting.Parameters and example
Parameters and example
eval_config
Load criteria with shared model defaults and the selected trajectory.Parameters and example
Parameters and example
eval_dependencies
Validate the shared evaluation engine before loading either framework adapter.Example
Example
metric
Adapt a context-based scorer to ADK’s four-argument custom metric contract. Return a MetricScore for the whole conversation, a sequence with one score per actual invocation, or a native ADK EvaluationResult. Native ADK scorers can also remain undecorated and register through the same customMetrics map.Parameters and example
Parameters and example
require_eval_trajectory
Reject unknown tool-trajectory policies at every evaluation entrypoint.Parameters and example
Parameters and example
supported_metric_names
Reflect the installed ADK metric registry instead of freezing an allowlist.Example
Example