nemo_gym.base_responses_api_agent

View as Markdown

Module Contents

Classes

API

class nemo_gym.base_responses_api_agent.BaseResponsesAPIAgent()

Bases: BaseServer

config
BaseResponsesAPIAgentConfig
class nemo_gym.base_responses_api_agent.BaseResponsesAPIAgentConfig()

Bases: BaseRunServerInstanceConfig

skip_verification
bool = False
skip_verification_reward
float = 0.0
token_id_capture
bool = False
class nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent()

Bases: BaseResponsesAPIAgent, AggregateMetricsMixin, SimpleServer

config
BaseResponsesAPIAgentConfig
nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent._capture_correlation_enabled() -> bool

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.

nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent._model_call_capture_enabled() -> bool

Whether evaluation model-call observability is enabled.

nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent._token_id_capture_enabled() -> bool

Whether this agent explicitly opted into training-token capture.

nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent.aggregate_metrics(
body: nemo_gym.base_resources_server.AggregateMetricsRequest = Body()
) -> nemo_gym.base_resources_server.AggregateMetrics
async

Default: same RewardProfiler aggregation as resources server. Override to proxy.

nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent.base_url_for_run(
base_url: str,
body: typing.Any
) -> str

Apply this run’s capture path to a model-server root URL.

Append the API-version suffix after this method returns.

nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent.resolve_model_base_url(
model_server_name: str,
rollout_id: typing.Optional[str] = None
) -> str

Resolve a model-server URL with an optional rollout prefix.

nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent.responses(
body: nemo_gym.openai_utils.NeMoGymResponseCreateParamsNonStreaming = Body()
) -> nemo_gym.openai_utils.NeMoGymResponse
asyncabstract
nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent.rollout_id_from_run(
body: typing.Any
) -> typing.Optional[str]

Return the capture id for a run request.

Return None when capture is disabled. Return None when the body has no usable identity.

nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent.run(
body: nemo_gym.base_resources_server.BaseRunRequest = Body()
) -> nemo_gym.base_resources_server.BaseVerifyResponse
asyncabstract
nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent.setup_webserver() -> fastapi.FastAPI
nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent.url_path_for_request(
url_path: str,
request: typing.Optional[fastapi.Request]
) -> str

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.

nemo_gym.base_responses_api_agent.SimpleResponsesAPIAgent.url_path_for_run(
url_path: str,
body: typing.Any
) -> str

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.