Skip to content

EvaluationContext

junjo.evaluation.EvaluationContext

Kind: Class

SDK version: 0.69.0

Documentation channel: Stable release

EvaluationContext(run_class: EvaluationRunClass, dataset_id: str, source_revision: str, role: EvaluationRole = EvaluationRole.ORCHESTRATOR, run_id: str | None = None, case_id: str | None = None, case_key: str | None = None, attempt_id: str | None = None, version: int = EVALUATION_CONTEXT_VERSION)

View source

Immutable identities for one evaluation or generated-case execution.

Ordinary application execution does not need an EvaluationContext. Its absence is the compact representation of normal application traffic.

Name Type Description Default
run_class EvaluationRunClass Evaluation or dataset-generation classification.
dataset_id str Canonical Studio Dataset ID.
source_revision str Clean committed application source revision.
role EvaluationRole Role of the span or callback receiving this context. EvaluationRole.ORCHESTRATOR
run_id str | None Canonical Studio Run ID for an evaluation Attempt. None
case_id str | None Canonical Studio Case ID for an evaluation Attempt. None
case_key str | None Requested Case key before a generated Case exists. None
attempt_id str | None Canonical Studio Attempt ID for an evaluation Attempt. None

run_class: EvaluationRunClass

View source

Distinguishes execution to generate a dataset case from execution to evaluate a locked case.

dataset_id: str

View source

Studio identifier of the dataset containing the ordered cases.

source_revision: str

View source

Clean committed application Git revision associated with this execution.

role: EvaluationRole = EvaluationRole.ORCHESTRATOR

View source

Whether this span or callback orchestrates, executes the subject, judges, or verifies the result.

run_id: str | None = None

View source

Studio identifier of the evaluation run.

case_id: str | None = None

View source

Studio identifier of the immutable case used by this attempt.

case_key: str | None = None

View source

Requested key during case generation, before a canonical case ID exists.

attempt_id: str | None = None

View source

Studio identifier of one case attempt within an evaluation run.

version: int = EVALUATION_CONTEXT_VERSION

View source

Version of the evaluation identity context emitted in telemetry.

for_role(role: EvaluationRole) -> EvaluationContext

View source

Return a copy for one subject, judge, or verifier boundary.

attributes() -> dict[str, str | int]

View source

Return the exact bounded attributes governed by ADR 0014.