verifiers 0.4.2.dev30__py3-none-any.whl → 0.4.2.dev32__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/agent.py CHANGED
@@ -95,6 +95,16 @@ def resolve_rollout_timeouts(timeout: TimeoutConfig, task: Task) -> RolloutTimeo
95
95
  )
96
96
 
97
97
 
98
+ def _check_artifact_runtime(runtime_config: RuntimeConfig) -> None:
99
+ """Artifact collection reads the task's paths out of the box, so the box needs a
100
+ filesystem of its own."""
101
+ if not backend_cls(runtime_config).SUPPORTS_TASK_IMAGES:
102
+ raise TypeError(
103
+ "artifact collection requires a runtime with its own filesystem; the "
104
+ f"{runtime_config.type} runtime cannot run images"
105
+ )
106
+
107
+
98
108
  def _check_borrowed_placement(
99
109
  task: Task, runtime: Runtime, base_config: RuntimeConfig
100
110
  ) -> None:
@@ -747,14 +757,8 @@ class Agent:
747
757
  attempt: int,
748
758
  ) -> Trace:
749
759
  params = self._rollout_params(task, runtime, dict(shared_tools or {}))
750
- if (
751
- collect_artifacts
752
- and not backend_cls(params["runtime_config"]).SUPPORTS_TASK_IMAGES
753
- ):
754
- raise TypeError(
755
- "artifact collection requires a runtime with its own filesystem; the "
756
- f"{params['runtime_config'].type} runtime cannot run images"
757
- )
760
+ if collect_artifacts:
761
+ _check_artifact_runtime(params["runtime_config"])
758
762
  run = Rollout(
759
763
  task=task,
760
764
  on_trace=on_trace,
@@ -786,6 +790,7 @@ class Agent:
786
790
  runtime: Runtime | None = None,
787
791
  tools: Mapping[str, SharedToolServer] | None = None,
788
792
  on_trace: Callable[[Trace], None] | None = None,
793
+ collect_artifacts: bool = False,
789
794
  ) -> AsyncIterator[Interaction]:
790
795
  """Interact with this agent turn-by-turn: a full rollout of `task` where
791
796
  the CALLER is the run's user — the one exchange surface. Yields an
@@ -801,7 +806,8 @@ class Agent:
801
806
  caller's to hide: hand the interaction a task whose `data.prompt` is None
802
807
  and keep the scenario on a scoring-side field (the user-sim env's contract).
803
808
 
804
- `runtime` and `tools` borrow live resources from their owners, just as
809
+ `runtime` and `tools` borrow live resources from their owners, and
810
+ `collect_artifacts` captures the task's declared artifacts at close, just as
805
811
  they do for `run()`; an env supplies its taskset's shared tools
806
812
  automatically for tasks loaded from that taskset.
807
813
 
@@ -818,10 +824,13 @@ class Agent:
818
824
  trace_id = uuid.uuid4().hex
819
825
  with scope(trace=short_id(trace_id), agent=self._log_name):
820
826
  params = self._rollout_params(task, runtime, dict(tools or {}))
827
+ if collect_artifacts:
828
+ _check_artifact_runtime(params["runtime_config"])
821
829
  run = Rollout(
822
830
  task=task,
823
831
  has_user=True,
824
832
  on_trace=on_trace,
833
+ collect_artifacts=collect_artifacts,
825
834
  trace_id=trace_id,
826
835
  **params,
827
836
  )
@@ -1030,6 +1039,7 @@ class _EpisodeAgent(Agent):
1030
1039
  runtime: Runtime | None = None,
1031
1040
  tools: Mapping[str, SharedToolServer] | None = None,
1032
1041
  on_trace: Callable[[Trace], None] | None = None,
1042
+ collect_artifacts: bool = False,
1033
1043
  ) -> AsyncIterator[Interaction]:
1034
1044
  """The agent's `interaction`, with every trace stamped with its standing
1035
1045
  at mint and captured in `completed` at close — an interaction driven from
@@ -1051,6 +1061,7 @@ class _EpisodeAgent(Agent):
1051
1061
  runtime=runtime,
1052
1062
  tools=tools if tools is not None else self._shared_for(task),
1053
1063
  on_trace=self._watch(remember),
1064
+ collect_artifacts=collect_artifacts,
1054
1065
  ) as interaction:
1055
1066
  yield interaction
1056
1067
  finally:
@@ -422,7 +422,7 @@ class ChatDialect(Dialect[ChatCompletion]):
422
422
  "extra_body",
423
423
  }
424
424
  )
425
- routes = ("/v1/chat/completions",)
425
+ routes = ("/v1/chat/completions", "/chat/completions")
426
426
  upstream_path = "/chat/completions"
427
427
  response_type = ModdedChatCompletion
428
428
 
@@ -369,7 +369,7 @@ class ResponsesDialect(Dialect[OpenAIResponse]):
369
369
  "truncation",
370
370
  }
371
371
  )
372
- routes = ("/v1/responses",)
372
+ routes = ("/v1/responses", "/responses")
373
373
  upstream_path = "/responses"
374
374
  response_type = OpenAIResponse
375
375
 
@@ -27,7 +27,6 @@ PRIME_AGENT_COMMIT: Literal["ea9d9602ec0938d9e454e8963107cd85af1565c6"] = (
27
27
  PRIME_AGENT_VERSION = "0.10.2"
28
28
  PRIME_AGENT_DIR = "/var/tmp/vf-prime-agent"
29
29
  STATE_ROOT = "/tmp/vf-prime-agent-runs"
30
- PROVIDER = "intercept"
31
30
  LIFECYCLE_META_NAMESPACE = "ai.primeintellect.prime-agent"
32
31
  KEY_VAR = "PRIME_AGENT_INTERCEPT_KEY"
33
32
  ENV_AGENT_DIR = "PRIME_AGENT_CODING_AGENT_DIR"
@@ -82,8 +81,7 @@ class PrimeAgentHarnessConfig(HarnessConfig):
82
81
 
83
82
  autonomous: bool = False
84
83
  """Enable Prime Agent's autonomous continuation loop."""
85
- # Over Responses it replays an earlier turn without its reasoning.
86
- dialect: Literal["chat_completions", "anthropic_messages"] = "chat_completions"
84
+ dialect: Literal["auto"] = "auto"
87
85
 
88
86
 
89
87
  class PrimeAgentHarness(ACPHarness[PrimeAgentHarnessConfig]):
@@ -208,22 +206,20 @@ class PrimeAgentHarness(ACPHarness[PrimeAgentHarnessConfig]):
208
206
  None,
209
207
  "none",
210
208
  ) or ctx.model.rsplit("/", 1)[-1].startswith(("gpt-5", "o1", "o3", "o4"))
209
+ provider, separator, model = ctx.model.partition("/")
210
+ if not separator:
211
+ provider, model = "openai", ctx.model
212
+ elif provider in ("internal", "dev"):
213
+ provider, model = "prime-inference", ctx.model
211
214
  models = {
212
215
  "providers": {
213
- PROVIDER: {
214
- # Its Anthropic provider appends `/v1/messages` to the base URL.
215
- "baseUrl": endpoint.removesuffix("/v1")
216
- if self.config.dialect == "anthropic_messages"
217
- else endpoint,
218
- "api": {
219
- "chat_completions": "openai-completions",
220
- "responses": "openai-responses",
221
- "anthropic_messages": "anthropic-messages",
222
- }[self.config.dialect],
216
+ provider: {
217
+ # The native provider owns its API path, including any version prefix.
218
+ "baseUrl": endpoint.removesuffix("/v1"),
223
219
  "apiKey": KEY_VAR,
224
220
  "models": [
225
221
  {
226
- "id": ctx.model,
222
+ "id": model,
227
223
  "reasoning": reasoning,
228
224
  "input": ["text", "image"],
229
225
  }
@@ -246,9 +242,9 @@ class PrimeAgentHarness(ACPHarness[PrimeAgentHarnessConfig]):
246
242
  "acp",
247
243
  "--no-session", # The ACP connection owns the session's lifetime.
248
244
  "--provider",
249
- PROVIDER,
245
+ provider,
250
246
  "--model",
251
- ctx.model,
247
+ model,
252
248
  "--daemon-socket",
253
249
  f"{root}/daemon.sock",
254
250
  "--offline",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.4.2.dev30
3
+ Version: 0.4.2.dev32
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
@@ -1,6 +1,6 @@
1
1
  verifiers/__init__.py,sha256=F5IVMw6mhGaPBMCw7QKk0la_r5mMwydP2hdTTdQucik,352
2
2
  verifiers/v1/__init__.py,sha256=TB8TzPRiMc5kUlyWJNknoQ1GC-BpANsIyaeDk41ajUo,18542
3
- verifiers/v1/agent.py,sha256=3mRrubm2EwGIYexdJ9F0Lq5Uuta9-E_CC29Phh_9Vbw,48439
3
+ verifiers/v1/agent.py,sha256=bhZsET00xkaEWS6vwLjnqZcvImWZ0Cq1_A6Bzo1_PYU,48987
4
4
  verifiers/v1/delta.py,sha256=23USfU7G5L3TBnV3apyuOa0M_uQAgvTo6a4Ke4msRV0,12205
5
5
  verifiers/v1/env.py,sha256=UA1FdNd64XywIevJliNyL54afa2StN1ND6ro9HrjlVo,20566
6
6
  verifiers/v1/episode.py,sha256=ExeTkNEBsDuG40m6VogV6Gd4IHdO4SMPIzQSpt_V96U,6984
@@ -55,8 +55,8 @@ verifiers/v1/configs/cli/validate.py,sha256=j6qRi2EvacXTCARnVhkFRtX9xF3IP3eVVt-Z
55
55
  verifiers/v1/dialects/__init__.py,sha256=MNOYM2NdTlSxGK4VtoEjMtD5zya2MpjPDX5jMvZUWEo,736
56
56
  verifiers/v1/dialects/anthropic.py,sha256=5FZyAV2Aa9UU_tmoSJi4_FYxSw_QFk5e0v0v6LNxKk0,27338
57
57
  verifiers/v1/dialects/base.py,sha256=9C0Co6XAQrZsIWnJiAMtwPF5B00z-c20_RiSs51-TG4,16227
58
- verifiers/v1/dialects/chat.py,sha256=J3Q1DF6_armq8NWJ1AAlUgAveNuX-LFDaArUIRMYyfY,24487
59
- verifiers/v1/dialects/responses.py,sha256=jd8-xZ65MOtnHnnH295s4TCUgvDbfyYg0ialKo3HvgE,31259
58
+ verifiers/v1/dialects/chat.py,sha256=quhjv9ipa0ces3VYB5ZbegB_RwIAK5vj17c6NiQF74s,24507
59
+ verifiers/v1/dialects/responses.py,sha256=aoRe94g_Wa2BfHfEUdM8XVesn-RcwfXHoXl1lN4r-qE,31272
60
60
  verifiers/v1/envs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
61
  verifiers/v1/envs/agentic_judge/__init__.py,sha256=6vwtMCQ_cuvuubCF5-nrE5W7gGgzE-LIPKorkM5DXdw,309
62
62
  verifiers/v1/envs/agentic_judge/env.py,sha256=AkANEM5mSiGJ-udJWvHKeNMVq4wRcWpXX0yOJ2qqS78,14968
@@ -109,7 +109,7 @@ verifiers/v1/harnesses/pi/__init__.py,sha256=1mSnzOf-RdEchdeg6IHtcdobG5KIpAhuTdU
109
109
  verifiers/v1/harnesses/pi/gate.mjs,sha256=vk_OqHXhRdYzQL7YMX8Teajm0fh9tokzDvLHVOd2I9o,449
110
110
  verifiers/v1/harnesses/pi/harness.py,sha256=NURYJCiE5kIB9CXIMYgvaCtFdiGpHaiWU84rOntF-3A,7753
111
111
  verifiers/v1/harnesses/prime_agent/__init__.py,sha256=xfPC4RrlnyYWaf38tPAOZq4YL6M55lMpj5BoRLmaK8I,171
112
- verifiers/v1/harnesses/prime_agent/harness.py,sha256=nDxGLhVtwb5RP83BbMZCEHtS2kGOtBIFXqLdk9YorMM,12618
112
+ verifiers/v1/harnesses/prime_agent/harness.py,sha256=sV82MCi7uZTKlOH8Vg9_WSytgZNSbknShOhmYcdPPaE,12354
113
113
  verifiers/v1/harnesses/rlm/__init__.py,sha256=hwx51xTdEWzzYgMj-p4ETNcptoub3IPMDbEdJ4uB8Ns,122
114
114
  verifiers/v1/harnesses/rlm/harness.py,sha256=4Q6g93YJp9JQQWoCaNRYX6ojaMzoBGEuSHbChnJYprg,14873
115
115
  verifiers/v1/harnesses/stirrup/__init__.py,sha256=a-NQxX1bOwaGx8QHj2jWcRJEGiLIxdY6XUMbojr9dOk,142
@@ -193,8 +193,8 @@ verifiers/v1/utils/scope.py,sha256=zbs4pj6AVk4jywlAJ3AX0Q0_kzB9dBB02nY-9H4ELdQ,8
193
193
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
194
194
  verifiers/v1/utils/trace_store.py,sha256=Qo9qvsJAl8PoRUavjQAfUB2VNxmUtYQtU2ejLKPzY9c,3382
195
195
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
196
- verifiers-0.4.2.dev30.dist-info/METADATA,sha256=4Hqn7rY_wdYh8e_puZgnQLBJvOoCshGo8ExQ2B9hdAs,5142
197
- verifiers-0.4.2.dev30.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
198
- verifiers-0.4.2.dev30.dist-info/entry_points.txt,sha256=3M8Wr0w1cUKiB-fJ6YHB6eK5WuKYg-Y3OC4wCuUje_c,174
199
- verifiers-0.4.2.dev30.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
- verifiers-0.4.2.dev30.dist-info/RECORD,,
196
+ verifiers-0.4.2.dev32.dist-info/METADATA,sha256=7keNwz0BTCgoJ5epJNU_pZckYmEMZGtWOnwjDCn2bEI,5142
197
+ verifiers-0.4.2.dev32.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
198
+ verifiers-0.4.2.dev32.dist-info/entry_points.txt,sha256=3M8Wr0w1cUKiB-fJ6YHB6eK5WuKYg-Y3OC4wCuUje_c,174
199
+ verifiers-0.4.2.dev32.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
+ verifiers-0.4.2.dev32.dist-info/RECORD,,