nemo_rl.environments.nemo_gym_task#
Access task inputs from Gym’s materialized task rows and flat rows.
Module Contents#
Functions#
Match Gym’s materialized-task routing discriminator. |
|
Return a taskset for materialized tasks or the resolved agent for flat rows. |
|
Return mutable input from a materialized task row or the entire flat row. |
API#
- nemo_rl.environments.nemo_gym_task.is_nemo_gym_task(
- row: collections.abc.Mapping[str, Any],
Match Gym’s materialized-task routing discriminator.
Flat rows may also contain a
task_idfield. A structured identity together withtask_inputselects the episode protocol, even when the identity is invalid. Full protocol validation remains Gym’s responsibility.
- nemo_rl.environments.nemo_gym_task.get_nemo_gym_attribution_key(
- row: collections.abc.Mapping[str, Any],
Return a taskset for materialized tasks or the resolved agent for flat rows.
Processed rollout results retain this identity in
attribution_keywhen the original task envelope is no longer present.
- nemo_rl.environments.nemo_gym_task.get_nemo_gym_task_input(
- row: dict[str, Any],
Return mutable input from a materialized task row or the entire flat row.
Callers can update Responses parameters in place while retaining materialized task identity, opaque task data, and RL metadata in the original envelope.
- Raises:
TypeError – If a materialized task’s
task_inputis not a dictionary.