nemo_gym.prompt
nemo_gym.prompt
Prompt configuration: YAML-based prompt templates applied at rollout time.
Prompt templates are mutually exclusive with pre-populated
responses_create_params.input values. This separation enables prompt
sweeps without re-preparing data.
Module Contents
Classes
Functions
API
Bases: BaseNeMoGymCLIConfig
Apply a prompt template to raw JSONL data, producing materialized JSONL
with populated responses_create_params.input for RL training.
Examples:
Bases: BaseModel
Schema for a prompt YAML file. user is required, system is optional.
Resolve a path relative to the Gym root (PARENT_DIR), consistent with config_paths resolution.
Apply prompt_config to a row, building responses_create_params.input.
Other fields in responses_create_params (tools, metadata, temperature, max_output_tokens) are preserved. Returns a new dict (does not mutate the original).
Apply a prompt template to a data row, producing message dicts.
Placeholders ({field_name}) are filled from the row’s top-level
fields. Literal braces must be doubled ({{ / }}).
Load and validate a YAML prompt config file.
Relative paths are resolved against the Gym root directory (PARENT_DIR),
consistent with how config_paths and other Gym paths are resolved.
Returns a PromptConfig with required user and optional system fields.
Each value is a string template with {placeholder} syntax.
Results are cached so the same file is only parsed once.
Apply a prompt template to raw JSONL data, producing materialized JSONL.
Reads each row from input_jsonl, validates that no row has pre-populated
responses_create_params.input, applies the prompt template, and writes
the result to output_jsonl.
Parameters:
Path to raw JSONL (no responses_create_params.input).
Path to prompt YAML file.
Path to write materialized JSONL (with responses_create_params.input).
CLI entry point for ng_materialize_prompts.
Validate that no rows have pre-populated responses_create_params.input when a prompt_config is provided.
Collects all violating row indices and reports them in a single error.