feat(resources): add shared MultiRewardVerifyResponse contract#1793
Open
rodboev wants to merge 2 commits into
Open
feat(resources): add shared MultiRewardVerifyResponse contract#1793rodboev wants to merge 2 commits into
rodboev wants to merge 2 commits into
Conversation
…A-NeMo#1664) Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a shared
MultiRewardVerifyResponsecontract innemo_gymso multi-reward verifiers can exposereward_componentsthrough an importable shared type instead of an example-local subclass, and update the checked-in multi-reward docs to teach that shared contract.Closes #1664
Follow-up to #1525, which introduced the example-local
reward_componentsshape and the GDPO motivation that this shared contract now formalizes.Background
The example tool-call multi-reward server already documents
reward_componentsas the contract GDPO-style consumers should read, but currentorigin/maindefines that field only onresources_servers/example_tool_call_multireward/app.py's local response subclass. That leaves new multi-reward environments without a sharednemo_gymtype to inherit.Changes
MultiRewardVerifyResponse(BaseVerifyResponse)innemo_gym.base_resources_serverwith optionalreward_components.correctness,schema_valid,format, andpredicted_callsfields.Scope
BaseVerifyResponseremains scalar-only for existing single-reward verifiers.Before / After
reward_componentsexists only onToolCallMultiRewardVerifyResponseinsideresources_servers/example_tool_call_multireward/app.py.reward_componentslives on sharedMultiRewardVerifyResponse, the example response inherits that contract instead of defining it locally, and the latest tutorial/API reference now point users at the shared type.Validation
ng_test +entrypoint=resources_servers/example_tool_call_multireward(Not run locally.)pre-commit run --files nemo_gym/base_resources_server.py resources_servers/example_tool_call_multireward/app.py resources_servers/example_tool_call_multireward/tests/test_app.py resources_servers/example_tool_call_multireward/README.md(Not run locally.)ruff check --config pyproject.toml nemo_gym/base_resources_server.py resources_servers/example_tool_call_multireward/app.py resources_servers/example_tool_call_multireward/tests/test_app.pyruff format --config pyproject.toml --check nemo_gym/base_resources_server.py resources_servers/example_tool_call_multireward/app.py resources_servers/example_tool_call_multireward/tests/test_app.pynpm run checkinfern/Notes
The latest docs now teach the shared contract directly. The version-pinned
fern/versions/v0.3.0API reference was left unchanged.