Skip to content

Commit 378ba22

Browse files
committed
chore: add examples
1 parent 3d85361 commit 378ba22

2 files changed

Lines changed: 224 additions & 0 deletions

File tree

  • packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_eval
  • sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/agent_eval

packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_eval/results.py

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,85 @@ class AgentEvalSummary(BaseModel):
9999
"'<metric_type>.<output>', plus per-semantic-view rollups named 'view.<name>'. "
100100
"Failed or missing scores are surfaced as nan_count."
101101
),
102+
examples=[
103+
# Emission order is real: metric outputs, then views, then pass@k. Note that pass@k
104+
# counts *tasks* (4) where the metric output counts *trials* (10).
105+
{
106+
"scores": [
107+
{
108+
"name": "harbor_reward.reward",
109+
"score_type": "range",
110+
"count": 10,
111+
"nan_count": 2,
112+
"mean": 0.6,
113+
"min": 0.0,
114+
"max": 1.0,
115+
"std_dev": 0.4899,
116+
},
117+
{
118+
"name": "view.legal_quality",
119+
"score_type": "range",
120+
"count": 8,
121+
"nan_count": 4,
122+
"mean": 0.7375,
123+
"min": 0.1,
124+
"max": 1.0,
125+
"std_dev": 0.3674,
126+
},
127+
{
128+
"name": "harbor_reward.reward.pass@1",
129+
"score_type": "range",
130+
"count": 4,
131+
"nan_count": 1,
132+
"mean": 0.5,
133+
"min": 0.0,
134+
"max": 1.0,
135+
"std_dev": 0.3727,
136+
},
137+
{
138+
"name": "harbor_reward.reward.pass@2",
139+
"score_type": "range",
140+
"count": 4,
141+
"nan_count": 1,
142+
"mean": 0.6667,
143+
"min": 0.0,
144+
"max": 1.0,
145+
"std_dev": 0.4082,
146+
},
147+
]
148+
},
149+
# A separate run, because a runner's imported figures cannot co-occur with another
150+
# runner's metrics. Scalars carry `value` and no distribution, and no `count` when the
151+
# backend reports a figure without the sample size behind it.
152+
{
153+
"scores": [
154+
{
155+
"name": "gym_reward.reward",
156+
"score_type": "range",
157+
"count": 20,
158+
"nan_count": 0,
159+
"mean": 0.65,
160+
"min": 0.0,
161+
"max": 1.0,
162+
"std_dev": 0.477,
163+
},
164+
{"name": "runner.gym.pass@1/accuracy", "score_type": "scalar", "nan_count": 0, "value": 0.68},
165+
]
166+
},
167+
],
102168
)
103169
metric_coverage: dict[str, dict[str, AgentEvalMetricOutputCoverage]] = Field(
104170
default_factory=dict,
105171
description="Per-metric, per-output coverage counts (total/scored/failed/missing).",
172+
examples=[
173+
# Same 12 trials under two metrics, which is what distinguishes a low mean from low
174+
# coverage. The two dead trials fail every metric; the judge failed once more on its own,
175+
# and once completed without emitting its output at all (missing, not failed).
176+
{
177+
"harbor_reward": {"reward": {"total": 12, "scored": 10, "failed": 2, "missing": 0}},
178+
"rubric_judge": {"criteria_pass_rate": {"total": 12, "scored": 8, "failed": 3, "missing": 1}},
179+
}
180+
],
106181
)
107182
task_metric_attempts: dict[str, dict[str, list[AgentEvalAttemptValue]]] = Field(
108183
default_factory=dict,
@@ -114,6 +189,42 @@ class AgentEvalSummary(BaseModel):
114189
"all, so each key's list is independent: align by trial_id, never by position. An empty "
115190
"list means nothing was measured, including a task that produced no trial."
116191
),
192+
examples=[
193+
{
194+
"contract-review-msa-indemnity": {
195+
"harbor_reward.reward": [
196+
{"trial_id": "contract-review-msa-indemnity__k3f9wq2", "value": 1.0},
197+
{"trial_id": "contract-review-msa-indemnity__t7m2xb4", "value": 0.0},
198+
{"trial_id": "contract-review-msa-indemnity__9jr4vd1", "value": 1.0},
199+
],
200+
# t7m2xb4 is absent here rather than null: its judge timed out, so that attempt
201+
# went unmeasured. Index 1 is therefore a different trial in each of these lists.
202+
"rubric_judge.criteria_pass_rate": [
203+
{"trial_id": "contract-review-msa-indemnity__k3f9wq2", "value": 0.75},
204+
{"trial_id": "contract-review-msa-indemnity__9jr4vd1", "value": 1.0},
205+
],
206+
},
207+
"nda-scope-carveouts": {
208+
# p2hn8sc died in the sandbox, so it is null in every key: an attempt that
209+
# happened and did not pass, as opposed to one that was never measured.
210+
"harbor_reward.reward": [
211+
{"trial_id": "nda-scope-carveouts__p2hn8sc", "value": None},
212+
{"trial_id": "nda-scope-carveouts__w5db3qy", "value": 1.0},
213+
{"trial_id": "nda-scope-carveouts__z8kt1nf", "value": 0.0},
214+
],
215+
"rubric_judge.criteria_pass_rate": [
216+
{"trial_id": "nda-scope-carveouts__p2hn8sc", "value": None},
217+
{"trial_id": "nda-scope-carveouts__w5db3qy", "value": 0.6},
218+
{"trial_id": "nda-scope-carveouts__z8kt1nf", "value": 0.2},
219+
],
220+
},
221+
# Requested, but the runner returned no trial for it: keys declared, nothing measured.
222+
"merger-hsr-filing-threshold": {
223+
"harbor_reward.reward": [],
224+
"rubric_judge.criteria_pass_rate": [],
225+
},
226+
}
227+
],
117228
)
118229
task_count: int = Field(default=0, description="Number of tasks represented in the run.")
119230
trial_count: int = Field(default=0, description="Number of distinct trials scored.")

sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/agent_eval/results.py

Lines changed: 113 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)