nemo_gym.trajectory.atif_export
nemo_gym.trajectory.atif_export
Strict offline conversion from Gym rollout trajectories to ATIF v1.7.
Module Contents
Classes
Functions
Data
_KNOWN_INCOMPLETE_FINISH_REASONS
API
Bases: ConfigError
A rollout cannot be represented by Gym’s supported ATIF profile.
Bases: RunExportConfig
Settings of gym eval export atif.
The Terminus extension: a user turn after agent output is what that step observed.
Validate a redundant turn copy and compare its normalized supported fields.
The live profile’s tool arguments: a string that is not a JSON object becomes {}, kept verbatim.
A harness that survives a malformed call (it hands the model a tool error and goes on) produced a
gradable episode; the original string travels in the call’s extra and the trajectory is partial.
The live profile’s reading of a step’s reasoning items: lossy where a model is, never failing on it.
Empty and encrypted reasoning (OpenAI reasoning models answer with summary: [] unless a summary
is requested) export without reasoning_content; several segments, from several items or one
item’s summary list (one <think> block each), join with newlines. Each departure from the strict
mapping is named in reasons, so the trajectory says it is partial. Only a segment without text
(a converter defect) still raises.
Reject raw fields that supported Pydantic variants would silently erase.
Return provider item identities that ATIF has no standard fields for.
Text content of a message or tool output; images and other parts are not representable.
With reasons (the model’s own output), a refusal part exports as its text and is noted there:
the model refused, the harness went on, and the episode is still graded, as Harbor grades a refused
Terminus turn (Harbor keeps an empty step; the text is kept here). Without it, a refusal is rejected
like any other non-text part.
Reject Python values that cannot round-trip through UTF-8 JSON unchanged.
The trajectory as the UTF-8 JSON bytes Harbor reads from trajectory.json.
Validate a rollout JSONL completely, then atomically publish ATIF files and a manifest.
Convert one rollout row, rejecting any structure Gym cannot represent completely.
Convert a live Responses API transcript into an ATIF v1.7 trajectory.
input_items is the task’s responses_create_params.input (a string or item list) and
output_items the agent’s response.output. Shapes a model causes (reasoning without an answer
when it ran out of tokens, several reasoning segments, empty or encrypted reasoning, arguments that are
not a JSON object) export with the departure named under extra.nemo_gym.conversion (status: partial, reasons); raises AtifExportError only for what the mapping cannot represent at
all (a copied assistant turn, a later system turn, a result for no call or a second
function_call_output for the same call_id, item types ATIF has no place for).