verifiers 0.3.1.dev63__py3-none-any.whl → 0.3.1.dev64__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.
@@ -359,12 +359,8 @@ class TrainClient(Client):
359
359
  multi_modal_data = None
360
360
  prompt_attribution: RenderedTokens | None = None
361
361
  model = body["model"]
362
- raw_sampling = sampling.model_dump(exclude_none=True)
363
- sampling_params: dict[str, Any] = dict(
364
- raw_sampling.pop("extra_body", None) or {}
365
- )
362
+ sampling_params = sampling.wire_args()
366
363
  chat_template_kwargs = sampling_params.pop("chat_template_kwargs", None)
367
- sampling_params.update(raw_sampling)
368
364
  pool = ElasticRendererPool(
369
365
  self.config.renderer_model_name or model,
370
366
  self.config.renderer,
@@ -443,6 +443,7 @@ class AnthropicDialect(Dialect[MessageCreateParams, AnthropicMessage]):
443
443
  "top_p",
444
444
  "top_k",
445
445
  "max_tokens",
446
+ "service_tier",
446
447
  "stop_sequences",
447
448
  "thinking",
448
449
  "tool_choice",
@@ -700,19 +701,17 @@ class AnthropicDialect(Dialect[MessageCreateParams, AnthropicMessage]):
700
701
  # Preserve native fields except the eval's model + sampling. `temperature`/`top_p` are
701
702
  # authoritative (always dropped, the eval's applied if set); `max_tokens` is required by
702
703
  # the API, so the program's is kept unless the eval sets one.
703
- s = sampling.model_dump(exclude_none=True)
704
- overrides: dict = {"model": model}
705
- if "temperature" in s:
706
- overrides["temperature"] = s["temperature"]
707
- if "top_p" in s:
708
- overrides["top_p"] = s["top_p"]
709
- if "max_tokens" in s:
710
- overrides["max_tokens"] = s["max_tokens"]
711
- if "reasoning_effort" in s:
704
+ s = sampling.wire_args()
705
+ reasoning_effort = s.pop("reasoning_effort", None)
706
+ sampling_output_config = s.pop("output_config", None)
707
+ overrides: dict = {**s, "model": model}
708
+ if sampling_output_config is not None or reasoning_effort is not None:
712
709
  overrides["output_config"] = {
713
710
  **dict(body.get("output_config") or {}),
714
- "effort": s["reasoning_effort"],
711
+ **dict(sampling_output_config or {}),
715
712
  }
713
+ if reasoning_effort is not None:
714
+ overrides["output_config"]["effort"] = reasoning_effort
716
715
  steered = {
717
716
  k: v
718
717
  for k, v in body.items()
@@ -347,6 +347,7 @@ class ChatDialect(Dialect[CompletionCreateParams, ChatCompletion]):
347
347
  "presence_penalty",
348
348
  "repetition_penalty",
349
349
  "response_format",
350
+ "service_tier",
350
351
  "tool_choice",
351
352
  "parallel_tool_calls",
352
353
  "extra_body",
@@ -550,7 +551,15 @@ class ChatDialect(Dialect[CompletionCreateParams, ChatCompletion]):
550
551
  # Preserve the program's native fields, overlaying only what the eval owns: the model and
551
552
  # the sampling knobs it set. The selected model is authoritative even if a permissive
552
553
  # sampling config carries an extra field named `model`.
554
+ overrides = sampling.wire_args()
555
+ max_token_keys = {"max_tokens", "max_completion_tokens"}
556
+ max_tokens_overridden = not max_token_keys.isdisjoint(overrides)
557
+ steered = {
558
+ k: v
559
+ for k, v in body.items()
560
+ if not max_tokens_overridden or k not in max_token_keys
561
+ }
553
562
  return cast(
554
563
  CompletionCreateParams,
555
- {**body, **sampling.model_dump(exclude_none=True), "model": model},
564
+ {**steered, **overrides, "model": model},
556
565
  )
@@ -427,6 +427,7 @@ class ResponsesDialect(Dialect[ResponseCreateParams, OpenAIResponse]):
427
427
  "max_output_tokens",
428
428
  "max_tool_calls",
429
429
  "reasoning",
430
+ "service_tier",
430
431
  "text",
431
432
  "tool_choice",
432
433
  "parallel_tool_calls",
@@ -756,32 +757,32 @@ class ResponsesDialect(Dialect[ResponseCreateParams, OpenAIResponse]):
756
757
  ) -> ResponseCreateParams:
757
758
  # Preserve native fields except the eval's model + sampling, mapped to the Responses shape
758
759
  # (`max_tokens` -> `max_output_tokens`); sampling is authoritative.
759
- s = sampling.model_dump(exclude_none=True)
760
+ s = sampling.wire_args()
761
+ max_tokens = s.pop("max_tokens", None)
762
+ reasoning_effort = s.pop("reasoning_effort", None)
763
+ sampling_reasoning = s.pop("reasoning", None)
760
764
  name = model.rsplit("/", 1)[-1]
761
765
  reasoning_model = (
762
766
  name.startswith(("gpt-5", "o1", "o3", "o4"))
763
767
  and "-chat" not in name
764
768
  and ("/" not in model or model.startswith("openai/"))
765
769
  )
766
- overrides: dict = {"model": model}
770
+ overrides: dict = {**s, "model": model}
767
771
  if reasoning_model:
768
772
  # Preserve opaque reasoning state so it can be replayed on the next turn.
769
- include = list(body.get("include") or [])
773
+ include = list(overrides.get("include") or body.get("include") or [])
770
774
  if "reasoning.encrypted_content" not in include:
771
775
  include.append("reasoning.encrypted_content")
772
776
  overrides["include"] = include
773
- if "temperature" in s:
774
- overrides["temperature"] = s["temperature"]
775
- if "top_p" in s:
776
- overrides["top_p"] = s["top_p"]
777
- if "max_tokens" in s:
778
- overrides["max_output_tokens"] = s["max_tokens"]
779
- reasoning = dict(body.get("reasoning") or {})
780
- if reasoning_model:
781
- # Summaries provide the trace's readable reasoning text.
782
- reasoning = {"summary": "auto", **reasoning}
783
- if "reasoning_effort" in s:
784
- reasoning["effort"] = s["reasoning_effort"]
777
+ if max_tokens is not None:
778
+ overrides["max_output_tokens"] = max_tokens
779
+ reasoning = {
780
+ **({"summary": "auto"} if reasoning_model else {}),
781
+ **dict(body.get("reasoning") or {}),
782
+ **dict(sampling_reasoning or {}),
783
+ }
784
+ if reasoning_effort is not None:
785
+ reasoning["effort"] = reasoning_effort
785
786
  if reasoning:
786
787
  overrides["reasoning"] = reasoning
787
788
  steered = {
verifiers/v1/types.py CHANGED
@@ -250,6 +250,18 @@ class SamplingConfig(BaseModel):
250
250
  None, validation_alias=AliasChoices("max_tokens", "max_completion_tokens")
251
251
  )
252
252
 
253
+ def wire_args(self) -> dict[str, Any]:
254
+ """Flatten OpenAI-style ``extra_body`` before building a provider request."""
255
+ args = self.model_dump(exclude_none=True)
256
+ extra_body = {
257
+ key: value
258
+ for key, value in (args.pop("extra_body", None) or {}).items()
259
+ if value is not None
260
+ }
261
+ if "max_tokens" in args:
262
+ extra_body.pop("max_completion_tokens", None)
263
+ return {**extra_body, **args}
264
+
253
265
 
254
266
  Sampling = SamplingConfig
255
267
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.1.dev63
3
+ Version: 0.3.1.dev64
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
@@ -182,7 +182,7 @@ verifiers/v1/state.py,sha256=EckF2bWp-vV4b1jYJ9sLI5xrfGuI5spIgYYwW926toI,595
182
182
  verifiers/v1/task.py,sha256=ZiAE5uGxgHWqz8UF5YJHs80RgSKhxGMGQo4lJusSRus,11375
183
183
  verifiers/v1/taskset.py,sha256=fp2E0IEhL_Ybj9cegZwljfTmW27p_30zTWHFKw_kXE4,4374
184
184
  verifiers/v1/trace.py,sha256=GbuQVcPUFdBYSXqeO36UT6xKBQCtY656Tg8Icgut_xk,24908
185
- verifiers/v1/types.py,sha256=-0MFoN-_94B2GhDDwFOcRp-nlTki53f-5bV-ZOOxCSY,9119
185
+ verifiers/v1/types.py,sha256=P80GZ-_J1lfro6fGQage7ZtKA1ylHlA8HnVx65ySh5M,9592
186
186
  verifiers/v1/acp/__init__.py,sha256=-QQh5ZT0o9j98CzqltsheccmM3Xqqyneu-vN1U0NJ38,10232
187
187
  verifiers/v1/acp/runner.py,sha256=aP7yyXMDp1nkU-L20BSqcwqRo9YEhNnpM8u_dWfFpCw,9528
188
188
  verifiers/v1/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -207,7 +207,7 @@ verifiers/v1/clients/__init__.py,sha256=Ysig0tE_0E4Jsfgfes1XHN-fK1s_RCXdqZD6E7lK
207
207
  verifiers/v1/clients/base.py,sha256=PoDw4GMqrfuPTFVK6n2jDmlD0_lJ5zTrYcNio5yq6K8,1691
208
208
  verifiers/v1/clients/client.py,sha256=zqC_AkiD9pl0kxxIbupNiehbS-YnVdp3EMZ0LOHTd8U,3125
209
209
  verifiers/v1/clients/eval.py,sha256=-OcYUqlj8dBRjyuffMvymc1fMfZcjo-p5q8ZSMvDGzY,8106
210
- verifiers/v1/clients/train.py,sha256=9zcZSRjFLJpFfbulc6hKFr2ITMA-WZx2P7gogy4Gh9M,18684
210
+ verifiers/v1/clients/train.py,sha256=gCsk4zJN1eE5LcTR1_bC5mR-5y4mh4sW0AO3I-LxZUg,18511
211
211
  verifiers/v1/configs/__init__.py,sha256=X7u6X7B3ieD1HZl79Tv1kg-yPHbT0QLvAebaGqxVtvA,317
212
212
  verifiers/v1/configs/agent.py,sha256=L5P6ombAi4U5wwsspMHAuM8111sB9AVdm8q6B5iV1lw,3251
213
213
  verifiers/v1/configs/client.py,sha256=E7ZxeWBFV_AP8MyfxXncTZs-Yn-QKdDS57HCAzqVTrQ,4437
@@ -227,10 +227,10 @@ verifiers/v1/configs/cli/init.py,sha256=Vmuamb53F79UjGfS6lv-HBhndaM-YuVcjPCU0Jbv
227
227
  verifiers/v1/configs/cli/replay.py,sha256=xvMDZzIkvjgYl-a3ragjXI65DsD6FYl6gEFM5qpdIuA,2913
228
228
  verifiers/v1/configs/cli/validate.py,sha256=0LXGjqc9JxbCGTpMBX5OPsHCWxZw64uE1ky3ukQBULs,3654
229
229
  verifiers/v1/dialects/__init__.py,sha256=p72C7VYrFQzVgTcfmzpHGSwXlvThfc4pvjBxsqw7kHE,786
230
- verifiers/v1/dialects/anthropic.py,sha256=-eG00Rq8pygSwM2IoEy9iUgDb1ZdGQfP7tYb815nDJ8,27380
230
+ verifiers/v1/dialects/anthropic.py,sha256=lS3we2HbvS7QmbsQhlTnLdsEyDe3QtrUTUPzZ1geIqg,27441
231
231
  verifiers/v1/dialects/base.py,sha256=VwMm8RHXr0dK4Y4-wWn853ft1K7UCo1CCAivWhqFh3s,13068
232
- verifiers/v1/dialects/chat.py,sha256=uBo7q7x4bMrQGS1BSlq--CqB7TerGqiTiwmpmAPHrdw,22923
233
- verifiers/v1/dialects/responses.py,sha256=QbEPt7hXMkrQMCBVsCLGTnZU9t7Xku0r_Kza6g3z5VE,30475
232
+ verifiers/v1/dialects/chat.py,sha256=yLlpNwXfCSiDD_bWE7jnf7mIfopDem_yRPEGi3qD7xE,23256
233
+ verifiers/v1/dialects/responses.py,sha256=ayFjUJlbH2t0X1FCDoO9CWyHD_112oiaABgP82acEtA,30505
234
234
  verifiers/v1/envs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
235
235
  verifiers/v1/envs/agentic_judge/__init__.py,sha256=LfEcRHLG_siKzhzWmODDXWSLpLgfum3UFdQDK9XG0gk,325
236
236
  verifiers/v1/envs/agentic_judge/env.py,sha256=yVMdq0zBOX7vkEkhnhHTUDM-KKcoOIHUt7yEggOs4ng,14615
@@ -348,8 +348,8 @@ verifiers/v1/utils/prime.py,sha256=UTYRjp9cbjNb6CVmBHda-1wWZAIIfxNOmTyNuT7_wL4,9
348
348
  verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
349
349
  verifiers/v1/utils/score.py,sha256=-R5Cog14r_tJ6Q_oOfGr5VPAm2CCUhofYZB6B9lm4wM,5787
350
350
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
351
- verifiers-0.3.1.dev63.dist-info/METADATA,sha256=r0XAAWNHMBxSr7MeEqNQ7wqBuX52A9OtIHe5SWuZ6Ds,4653
352
- verifiers-0.3.1.dev63.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
353
- verifiers-0.3.1.dev63.dist-info/entry_points.txt,sha256=hZ5wDc1T8y-EvOziw7kQqatBJ6PbdSu2ygP5rjANl7c,564
354
- verifiers-0.3.1.dev63.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
355
- verifiers-0.3.1.dev63.dist-info/RECORD,,
351
+ verifiers-0.3.1.dev64.dist-info/METADATA,sha256=X12bayIx-98YWsQ0yuk75BaKtkTmc3gPm0ZVe0e7y98,4653
352
+ verifiers-0.3.1.dev64.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
353
+ verifiers-0.3.1.dev64.dist-info/entry_points.txt,sha256=hZ5wDc1T8y-EvOziw7kQqatBJ6PbdSu2ygP5rjANl7c,564
354
+ verifiers-0.3.1.dev64.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
355
+ verifiers-0.3.1.dev64.dist-info/RECORD,,