nemo_rl.environments.call_selection#

Select captured calls for training, independently of row reconstruction.

A selection policy is a synchronous callable (records, result) returning (selected_records, terminal_response_id). It must return unique, unchanged records from this attempt and identify the scored response within its selection. Order determines root/path priority, not storage ancestry. Policies choose membership; shared capture validation and reconstruction remain authoritative.

Module Contents#

Functions#

_output_items

Normalize ordinary output, retaining envelope boundaries and identities.

select_captured_calls

Resolve references and validate any accompanying ordinary output.

select_all_captured

Include all calls except unusable, unscored leaves, retaining attribution.

resolve_selection_policy

Resolve a built-in name or an importable package.module:function.

Data#

API#

nemo_rl.environments.call_selection._output_items(
result: dict[str, Any],
*,
captured_response_ids: set[str],
) → tuple[list[dict[str, Any]], dict[int, str | None]][source]#

Normalize ordinary output, retaining envelope boundaries and identities.

nemo_rl.environments.call_selection.select_captured_calls(
records: list[nemo_gym.token_id_capture.staging.records.CallRecord],
result: dict[str, Any],
) → tuple[list[nemo_gym.token_id_capture.staging.records.CallRecord], str | None][source]#

Resolve references and validate any accompanying ordinary output.

Stable IDs constrain content matching rather than overriding contradictions. Content-only matches must be unique locally; this is deliberately not an exponential search over possible transcript interpretations.

nemo_rl.environments.call_selection.select_all_captured(
records: list[nemo_gym.token_id_capture.staging.records.CallRecord],
result: dict[str, Any],
) → tuple[list[nemo_gym.token_id_capture.staging.records.CallRecord], str | None][source]#

Include all calls except unusable, unscored leaves, retaining attribution.

nemo_rl.environments.call_selection.SELECTION_POLICIES: dict[str, nemo_rl.environments.call_selection.SelectionPolicy]#

None

nemo_rl.environments.call_selection.resolve_selection_policy(
name: str,
) → nemo_rl.environments.call_selection.SelectionPolicy[source]#

Resolve a built-in name or an importable package.module:function.