Skip to navigation

nemo_gym.agents.agent_outcome

View as Markdown

Agent-reported causes, independent of environment grading and retry policy.

Module Contents

Classes

NameDescription
AgentOutcomeAdditional evidence distinguishing causes of a failed agent response.
AgentOutcomePolicyConfigExisting Environment Server defaults for classified failed agent responses.

Functions

NameDescription
agent_outcome_policyApply configured grading/retry rules to a classified failed response.
confirmed_policy_response_timeoutWhether the selected model operation timed out after upload on every observed attempt.
policy_timeout_failureThe agent’s policy-timeout failure for a failed model reply, or None.

Data

AGENT_OUTCOME_METADATA_KEY

POLICY_TIMEOUT_OPERATION

API

class nemo_gym.agents.agent_outcome.AgentOutcome()

Bases: BaseModel

Additional evidence distinguishing causes of a failed agent response.

Ordinary completion and limits already use response.status. HTTP status here belongs to the upstream model request, not the agent endpoint’s HTTP 200.

failure_kind
str
model_config
= ConfigDict(extra='forbid', frozen=True)
status_code
int | None = Field(default=None, ge=400, le=599, strict=True)
nemo_gym.agents.agent_outcome.AgentOutcome.require_registered_kind(
value: str
) -> str
classmethod

Accept the shared vocabulary plus an explicitly undetermined cause.

class nemo_gym.agents.agent_outcome.AgentOutcomePolicyConfig()

Bases: OutcomePolicyConfig

Existing Environment Server defaults for classified failed agent responses.

by_failure_kind
dict[str, OutcomeAction]
by_status_code
dict[Annotated[int, Field(ge=400, le=599)], OutcomeAction]
classification
FailureClassificationConfig = Field(default_factory=FailureClassificationConfig)
default_action
OutcomeAction = OutcomeAction.FAIL
supported_actions
frozenset[OutcomeAction]

Apply configured grading/retry rules to a classified failed response.

Unclassified legacy responses retain their existing grading behavior; malformed metadata is an ungraded, nonretryable failure regardless of configuration.

nemo_gym.agents.agent_outcome.confirmed_policy_response_timeout(
) -> bool

Whether the selected model operation timed out after upload on every observed attempt.

Unidentified, mixed, omitted or connecting attempts do not establish a final response timeout.

nemo_gym.agents.agent_outcome.policy_timeout_failure(
error: aiohttp.ClientResponseError

The agent’s policy-timeout failure for a failed model reply, or None.

The reply’s report must show that the final model call timed out after its upload on every attempt (confirmed_policy_response_timeout). The failure is caused by error, so its reply keeps the model’s attempts; raise it from error.

nemo_gym.agents.agent_outcome.AGENT_OUTCOME_METADATA_KEY = 'ng_agent_outcome'
nemo_gym.agents.agent_outcome.POLICY_TIMEOUT_OPERATION = 'agent.policy_request'