nemo_gym.base_responses_api_agent
nemo_gym.base_responses_api_agent
Module Contents
Classes
Data
API
Bases: BaseModel
Close agent-server state.
Bases: BaseModel
Confirm closure and return captured observations.
Bases: BaseModel
Idempotently initialize agent-server state under a caller-assigned identifier.
Repeating the same identifier and episode must return the existing session. Closing an unknown identifier must prevent a racing seed within the retry window. The shared implementation retains close responses for session_close_retry_window_seconds; callers must use unique IDs and finish retries within that window. External resources should use provider TTLs when available; there is no active-session expiry timer.
Bases: BaseModel
Confirm the caller-assigned agent session identifier.
Bases: Exception
Retain incomplete setup for close while propagating the original setup error.
Harness-owned session state with the immutable caller-assigned seed binding.
Bases: BaseServer
Bases: BaseRunServerInstanceConfig
Bases: BaseResponsesAPIAgent, AggregateMetricsMixin, SimpleServer
Return whether this agent needs rollout correlation.
Evaluation uses /ng-rollout/<id>/... for every agent.
Training capture uses /ng-rollout/<id>/training-token-capture/....
Training capture requires token_id_capture.enabled.
It also requires the static agent flag or run-level all_agents.
Missing global configuration disables correlation.
Release harness state, or raise without losing the handle needed for another close.
Whether evaluation model-call observability is enabled.
Validate grants and initialize harness state.
If setup fails and cleanup cannot finish, raise AgentSessionSetupError with the partial state and original error. The base retains it for close, never activation.
Whether this agent explicitly opted into training-token capture.
Default: same RewardProfiler aggregation as resources server. Override to proxy.
Apply this run’s capture path to a model-server root URL.
Append the API-version suffix after this method returns.
Retain successful close responses for a bounded retry window, including observations.
Failed cleanup keeps state for retry. Closing an unknown ID prevents a delayed seed within the same window. No timer cancels active sessions: the episode owner and sandbox provider retain responsibility for normal and crash cleanup.
Overlay episode-scoped tool access onto configured declarations by name.
Resolve a model-server URL with an optional rollout prefix.
Return the capture id for a run request.
Return None when capture is disabled.
Return None when the body has no usable identity.
Seed once per caller ID; identical retries reuse the same harness state.
Carry an inbound capture path onto a downstream URL path.
Prefixed self-calls expose the rollout id as a path parameter. Training-capture requests preserve their dedicated path segment. Unprefixed requests remain unchanged.
Apply this run’s capture path to a downstream URL path.
Evaluation uses /ng-rollout/<id>/....
Training capture uses /ng-rollout/<id>/training-token-capture/....
Calls without a rollout id remain unchanged.