nemo_gym.base_resources_server
nemo_gym.base_resources_server
Module Contents
Classes
Functions
Data
NEMO_GYM_MCP_SESSION_TOKEN_HEADER
API
Bases: BaseVerifyResponse
Base verify response for environments with multiple reward objectives.
Subclass this response instead of declaring reward_components on an
environment-specific BaseVerifyResponse subclass. The mapping is required, and
its objective keys should remain consistent across every task in the environment.
Set the inherited reward to the scalar aggregate expected by single-reward
consumers. To include individual objectives in aggregate metrics, also expose them
as top-level numeric fields because metrics do not descend into this mapping. See
resources_servers/example_tool_call_multireward for a complete example.
Bases: BaseServer
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
Bases: BaseRunRequest
Bases: BaseVerifyRequest
Bases: BaseModel
Metadata returned from /seed_session for per-rollout Gym MCP access.
Bases: enum.Enum
Bases: BaseResourcesServer, AggregateMetricsMixin, SimpleServer
Compute aggregate metrics from verify responses.
RewardProfiler provides baseline stats. Override compute_metrics() and/or get_key_metrics() for benchmark-specific customization.
Per-session tool restriction: return the tool names allowed for this rollout’s MCP token,
or None (the default) for unrestricted. seed_body is the JSON body POSTed to
/seed_session.
Return the MCP tools to expose (default: the auto-harvested typed POST routes).
Override to exclude (filter harvested), add catch-all-backed tools (harvested + [catchall.tool(…)]), or disable (return None). ‘catchall’ is None unless the server has one parameterized catch-all route.
Strip this server’s MCP namespace from a trajectory tool-call name (see module function).
Map a trajectory tool-call name to the server’s bare tool name.
HTTP-driven agents record bare tool names (“email_reply_email”); MCP-native agents (e.g.
Claude Code) record them namespaced per server (“mcp__workplace_assistant__email_reply_email”).
Verifiers compare trajectory names against dataset/ground-truth vocabulary, so names are
normalized before verify sees them and rollouts score identically on both transports.
Non-namespaced names pass through unchanged. When server_name is given, only that server’s
prefix is stripped (robust to tool names that themselves contain double underscores).
This runs only for servers exposed over MCP and mirrors how MCP clients namespace tool names,
so a real tool that is itself named mcp__<server>__x being stripped is accepted.