verifiers 0.4.2.dev30__py3-none-any.whl → 0.4.2.dev31__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:
@@ -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.dev31
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
@@ -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.dev31.dist-info/METADATA,sha256=M3FNjmZdz_JdefU9JSm3DhPQ4nwdMtPDs0zz0GzDQw4,5142
197
+ verifiers-0.4.2.dev31.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
198
+ verifiers-0.4.2.dev31.dist-info/entry_points.txt,sha256=3M8Wr0w1cUKiB-fJ6YHB6eK5WuKYg-Y3OC4wCuUje_c,174
199
+ verifiers-0.4.2.dev31.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
+ verifiers-0.4.2.dev31.dist-info/RECORD,,