Evaluation API reference
The supported evaluation surface is praval.eval. It is provider-neutral and
available in the base wheel. PostgreSQL methods require the storage dependency;
praval.eval.ragas is optional and intentionally not re-exported.
Datasets and immutable records
EvalCase,EvalSuite,LoadedEvalCase,LoadedEvalSuite, andload_jsonl_suite()define bounded datasets.EvaluationRun,EvaluationSubject,MetricResult,JudgeResult,GateResult, andEvaluationResultare immutable persisted records.EvaluationBaseline,EvaluationJob, andEvaluationAttemptcover explicit regression and durable online lifecycle.Status/operator/aggregation enums make serialized decisions stable.
Validation errors are ordinary Pydantic ValueError failures.
EvalDatasetError adds file/line context without exposing unrelated data.
Execution and judges
EvalRunnerexecutes aLoadedEvalSuitewith bounded concurrency.EvaluationTargetandTargetResultdefine the async target seam.AgentEvaluationTargetadapts a non-persistent ordinaryAgentand enforces one observation per case.Judge,JudgeContext,ModelJudge, andAgentJudgedefine strict evaluator composition.EvaluationExecutionError,JudgeConfigurationError, andJudgeResponseErrorreport invalid execution or configuration. Judge runtime failures normally become error results.
Metrics, gates, and plugins
Metric,ExactMatchMetric,TerminalSuccessMetric, andToolCallMatchMetricare asynchronous provider-free metrics.builtin_metrics(),discover_metric_plugins(), andavailable_metrics()expose deterministic plugin discovery underMETRIC_ENTRY_POINT_GROUP.MetricPluginErrorreports malformed, duplicate, or conflicting plugins.Gate,evaluate_gate(),compare_evaluation_runs(), andpromote_evaluation_baseline()implement explicit quality policy.GateEvaluationError,MetricComparison, andRunComparisondescribe invalid or completed comparisons.
Stores
EvaluationStore is the async structural contract. Both
SQLiteEvaluationStore and PostgresEvaluationStore provide migrations,
immutable idempotent writes, queries, baselines, jobs, leases, retries, and
attempts. Call migrate() before use and close() at shutdown.
EvaluationStoreError is the base persistence error;
EvaluationConflictError means an identity collision with different data.
Online evaluation
trace_sampled()makes a deterministic decision from a 128-bit trace ID.OnlineEvaluationProcessorandOnlineContextLoaderare async application seams.OnlineSubjectEvaluatorcomposes configured public judges and metrics.OnlineEvaluationService.start(),.record(),.stats(), and.shutdown()own the bounded scheduler/worker lifecycle.OnlineEvaluationStatscontains counters and queue metadata only.evaluation_call_scope()andis_evaluation_call()prevent recursive sampled evaluation.
For full signatures, parameter types, defaults, return values, and source
docstrings, see the generated praval.eval modules under API Reference.