verifiers 0.3.2.dev39__py3-none-any.whl → 0.3.2.dev40__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- verifiers/v1/cli/replay.py +1 -1
- verifiers/v1/judge.py +10 -2
- verifiers/v1/judges/rubric.py +1 -1
- verifiers/v1/trace.py +21 -2
- {verifiers-0.3.2.dev39.dist-info → verifiers-0.3.2.dev40.dist-info}/METADATA +1 -1
- {verifiers-0.3.2.dev39.dist-info → verifiers-0.3.2.dev40.dist-info}/RECORD +9 -9
- {verifiers-0.3.2.dev39.dist-info → verifiers-0.3.2.dev40.dist-info}/WHEEL +0 -0
- {verifiers-0.3.2.dev39.dist-info → verifiers-0.3.2.dev40.dist-info}/entry_points.txt +0 -0
- {verifiers-0.3.2.dev39.dist-info → verifiers-0.3.2.dev40.dist-info}/licenses/LICENSE +0 -0
verifiers/v1/cli/replay.py
CHANGED
|
@@ -156,7 +156,7 @@ async def run_replay(config: ReplayConfig, source: Path, out: Path) -> list[Trac
|
|
|
156
156
|
else:
|
|
157
157
|
st.state = "running"
|
|
158
158
|
# Clear the recorded scores; only offline-recomputable ones come back.
|
|
159
|
-
trace.info.pop("
|
|
159
|
+
trace.info.pop("judge_calls", None)
|
|
160
160
|
trace.rewards, trace.metrics, trace.extra_usage = {}, {}, []
|
|
161
161
|
# The declared Task for a rebuilt row, the base Task for the
|
|
162
162
|
# WireTaskData fallback.
|
verifiers/v1/judge.py
CHANGED
|
@@ -32,7 +32,8 @@ in which case `JudgeResponse.parsed` is the validated pydantic object.
|
|
|
32
32
|
A judge is cheap to construct (the HTTP client is opened per call, inside `complete`, and
|
|
33
33
|
closed when the call returns), so build it where you use it.
|
|
34
34
|
|
|
35
|
-
Passing `trace=` records the call onto it — a
|
|
35
|
+
Passing `trace=` records the call onto it — a request/response record appended to
|
|
36
|
+
`trace.info["judge_calls"]` and
|
|
36
37
|
the call's tokens + cost added to `trace.extra_usage` (kept separate from the agent's `trace.usage`),
|
|
37
38
|
so judge behaviour and spend are no longer invisible. The record lands even if the judge refuses, an
|
|
38
39
|
empty structured output comes back, or `parse` raises (the request was already billed). Omit `trace`
|
|
@@ -210,7 +211,14 @@ class Judge(Generic[ParsedT, ConfigT]):
|
|
|
210
211
|
return response
|
|
211
212
|
finally:
|
|
212
213
|
if trace is not None and response is not None:
|
|
213
|
-
trace.
|
|
214
|
+
trace.record_judge_call(
|
|
215
|
+
name=self.reward_name,
|
|
216
|
+
request={
|
|
217
|
+
"model": kwargs["model"],
|
|
218
|
+
"messages": kwargs["messages"],
|
|
219
|
+
},
|
|
220
|
+
response=response,
|
|
221
|
+
)
|
|
214
222
|
|
|
215
223
|
async def evaluate(
|
|
216
224
|
self, *, trace: Trace | None = None, **fields: Any
|
verifiers/v1/judges/rubric.py
CHANGED
|
@@ -24,7 +24,7 @@ RUBRIC_PROMPT = (Path(__file__).resolve().parent / "rubric.txt").read_text(
|
|
|
24
24
|
|
|
25
25
|
# Appended to the prompt when `structured_output` is off, so the reply is JSON we can parse. Each
|
|
26
26
|
# criterion carries a one-sentence `reason` written *before* the verdict (chain-of-thought), so the
|
|
27
|
-
# verdict follows from it and the reasoning is auditable in `trace.info["
|
|
27
|
+
# verdict follows from it and the reasoning is auditable in `trace.info["judge_calls"]`.
|
|
28
28
|
JSON_SUFFIX = (
|
|
29
29
|
"\n\nRespond with ONLY a JSON object and nothing else, in exactly this shape:\n"
|
|
30
30
|
'{"verdicts": [{"name": "<criterion name>", "reason": "<one sentence citing specific '
|
verifiers/v1/trace.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import copy
|
|
3
4
|
import time
|
|
4
5
|
import traceback
|
|
5
6
|
import uuid
|
|
@@ -672,8 +673,26 @@ class Trace(BaseModel, Generic[DataT, StateT, AgentConfigT]):
|
|
|
672
673
|
reward = Reward(score=float(value), weight=float(weight))
|
|
673
674
|
self.rewards[name] = reward
|
|
674
675
|
|
|
675
|
-
def
|
|
676
|
-
self
|
|
676
|
+
def record_judge_call(
|
|
677
|
+
self,
|
|
678
|
+
*,
|
|
679
|
+
name: str,
|
|
680
|
+
request: Mapping[str, Any],
|
|
681
|
+
response: JudgeResponse,
|
|
682
|
+
) -> None:
|
|
683
|
+
"""Record one complete judge request/response exchange."""
|
|
684
|
+
response_record = response.model_dump()
|
|
685
|
+
message = AssistantMessage(content=response_record.pop("text"))
|
|
686
|
+
self.info.setdefault("judge_calls", []).append(
|
|
687
|
+
{
|
|
688
|
+
"name": name,
|
|
689
|
+
"request": copy.deepcopy(dict(request)),
|
|
690
|
+
"response": {
|
|
691
|
+
"message": message.model_dump(),
|
|
692
|
+
**response_record,
|
|
693
|
+
},
|
|
694
|
+
}
|
|
695
|
+
)
|
|
677
696
|
if response.usage is not None:
|
|
678
697
|
self.extra_usage.append(response.usage)
|
|
679
698
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: verifiers
|
|
3
|
-
Version: 0.3.2.
|
|
3
|
+
Version: 0.3.2.dev40
|
|
4
4
|
Summary: Verifiers: Environments for LLM Reinforcement Learning
|
|
5
5
|
Project-URL: Homepage, https://github.com/primeintellect-ai/verifiers
|
|
6
6
|
Project-URL: Documentation, https://github.com/primeintellect-ai/verifiers
|
|
@@ -6,14 +6,14 @@ verifiers/v1/episode.py,sha256=uStvI4WqgJT50hmHIB55m5B-ASqqLz-fZ-ynBz9uzEY,5474
|
|
|
6
6
|
verifiers/v1/errors.py,sha256=uQySmCUrjDYFkBIii1vBFPiEcPFPQZ9EGpas_6HvcQI,5279
|
|
7
7
|
verifiers/v1/graph.py,sha256=F07EZIti0AspEQ-0R0Cg_E8wJeKRlBHP4CCWytSL_8Q,35496
|
|
8
8
|
verifiers/v1/harness.py,sha256=ziECqEBWV34UWbLlxrkhY6MwkbVYkoXBOoaY7mZxwTs,14753
|
|
9
|
-
verifiers/v1/judge.py,sha256=
|
|
9
|
+
verifiers/v1/judge.py,sha256=uqn-djkK2_7Q3kOjkDo6ipOvV_HOvuLa9y6AoDjRux8,9618
|
|
10
10
|
verifiers/v1/rollout.py,sha256=hoKGn1CbShbyjEM9PgYq8pdKgoC91VebTkBSgUHLtiE,23978
|
|
11
11
|
verifiers/v1/semantic.py,sha256=wssvBSEpY_tgzpFUADG9-N4HkDXgCZvNQ1pdf6qAsS0,4680
|
|
12
12
|
verifiers/v1/session.py,sha256=xM7JJJVJACk0JfH9RAN1Ts8gJJKr2tGGRiIgQTrdieY,18692
|
|
13
13
|
verifiers/v1/state.py,sha256=EckF2bWp-vV4b1jYJ9sLI5xrfGuI5spIgYYwW926toI,595
|
|
14
14
|
verifiers/v1/task.py,sha256=vaVkBu00riiNU1Ke4NeeY2NQTXxOguz9d6NLe55hO_Q,11468
|
|
15
15
|
verifiers/v1/taskset.py,sha256=fp2E0IEhL_Ybj9cegZwljfTmW27p_30zTWHFKw_kXE4,4374
|
|
16
|
-
verifiers/v1/trace.py,sha256
|
|
16
|
+
verifiers/v1/trace.py,sha256=-d4O06j3QG9dlv9nkWLupVjLt5-wqAf2GlXVgfBPcY8,29351
|
|
17
17
|
verifiers/v1/types.py,sha256=PH1SxRWXOjPCgQD9aZgM18_bECvFSNQ25gkCbulmTKU,9857
|
|
18
18
|
verifiers/v1/acp/__init__.py,sha256=wUPZVYBFjJuOnIIoYONBFuA04A1DJf_dOyKY3QwK37Q,12722
|
|
19
19
|
verifiers/v1/acp/runner.py,sha256=gMXFmsVg2qD0Zhrx7kvC6Me2Z-wsfBamRIO0i45UW8g,11097
|
|
@@ -22,7 +22,7 @@ verifiers/v1/cli/debug.py,sha256=x3bqOwwbwwfwQQpxHrZeKdxsW3ZVtUT9cAn_r4aOro4,116
|
|
|
22
22
|
verifiers/v1/cli/gepa.py,sha256=7YpppEMeuY2m1X5szGkybzTHztnIs83CvnSizhiEC-w,4210
|
|
23
23
|
verifiers/v1/cli/init.py,sha256=LFF_1e2XTdgIKjWoqq_IAlOzAXcARPEroblcEGv0fCU,7599
|
|
24
24
|
verifiers/v1/cli/output.py,sha256=HZbkHw662ppVdpTGutrKuQOSeBvtsAj5qjUokCkwkv0,8457
|
|
25
|
-
verifiers/v1/cli/replay.py,sha256=
|
|
25
|
+
verifiers/v1/cli/replay.py,sha256=2lL7h6MrIn6hIh7fuqbw7PmruCxkK5iqwoeKebr-z7Q,10246
|
|
26
26
|
verifiers/v1/cli/resolve.py,sha256=Q1EHM7wWQo0YkwJA898qtZbYLaIkjIVq3Q7kUp2YIxs,4346
|
|
27
27
|
verifiers/v1/cli/resume.py,sha256=hqV5AxxqeIInJeEZQerQznuijhMNijFEFcHZIltfLdE,470
|
|
28
28
|
verifiers/v1/cli/validate.py,sha256=G3YXZTwxVDQIyR_ASapJceixOxRSJl69NnFPBqkF3N0,17173
|
|
@@ -130,7 +130,7 @@ verifiers/v1/interception/tunnel/prime.py,sha256=fIhU4Sa53f2FQWrwIgpDjh8XO9E9RdF
|
|
|
130
130
|
verifiers/v1/judges/__init__.py,sha256=MUIBWcx6c70BykrTDHhB0ITIyJPxXe6xDBou4VM7jDQ,286
|
|
131
131
|
verifiers/v1/judges/reference.py,sha256=iEVHw-iJ6dbwLOOqrvWrEMJOcUEYJ0YspT04rZz7Sd4,3868
|
|
132
132
|
verifiers/v1/judges/reference.txt,sha256=Ej35kGXiT2uJ0LcHIeez49rCS_9uHmCQKoVdn93V6A8,353
|
|
133
|
-
verifiers/v1/judges/rubric.py,sha256=
|
|
133
|
+
verifiers/v1/judges/rubric.py,sha256=HGQYI3xdq8I84Ce0_sDeNgk5JM597es8rOVPipjCyxU,12025
|
|
134
134
|
verifiers/v1/judges/rubric.txt,sha256=3KA2ZeYYdcDweJhUGopxu9EFgARhu2aWft5S5cj8Bc8,323
|
|
135
135
|
verifiers/v1/mcp/__init__.py,sha256=pm8ZWBiL1q1tY4wHvJzM_QrZ9oR8aGm-bIRWiRJsgHI,408
|
|
136
136
|
verifiers/v1/mcp/launch.py,sha256=dqi5UCE-ShPn663glL4DwnTHk4_VBLG_0qUUwlr3p10,23776
|
|
@@ -185,8 +185,8 @@ verifiers/v1/utils/prime.py,sha256=UTYRjp9cbjNb6CVmBHda-1wWZAIIfxNOmTyNuT7_wL4,9
|
|
|
185
185
|
verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
|
|
186
186
|
verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
|
|
187
187
|
verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
|
|
188
|
-
verifiers-0.3.2.
|
|
189
|
-
verifiers-0.3.2.
|
|
190
|
-
verifiers-0.3.2.
|
|
191
|
-
verifiers-0.3.2.
|
|
192
|
-
verifiers-0.3.2.
|
|
188
|
+
verifiers-0.3.2.dev40.dist-info/METADATA,sha256=e5bkm_Lm2AKE8KvhdjM6WmekaMIDNsqwuHT0ivu7QF0,4065
|
|
189
|
+
verifiers-0.3.2.dev40.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
190
|
+
verifiers-0.3.2.dev40.dist-info/entry_points.txt,sha256=uqQje0TMsr7k6nXlWxlPs13Si0evb3pVCEDF6c-YL80,241
|
|
191
|
+
verifiers-0.3.2.dev40.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
|
|
192
|
+
verifiers-0.3.2.dev40.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|