Skip to navigation

nemo_gym.server_runtime.agent_context

View as MarkdownOpen in Claude

Per-task data an agent session receives beyond its initial model input.

Module Contents

Classes

NameDescription
AgentContextTask data the agent’s harness needs that is not part of the initial model input.
AgentContextArtifactA file or directory the agent reads, named by a path relative to a root the agent configures.

Data

AGENT_CONTEXT_KEY_NAME

AGENT_CONTEXT_MAX_BYTES

API

class nemo_gym.server_runtime.agent_context.AgentContext()

Bases: BaseModel

Task data the agent’s harness needs that is not part of the initial model input.

Small typed fields go inline in values; images, documents, files and skill directories go by reference in artifacts. A key appears in one of the two. Each agent declares the keys it accepts and refuses a seed that carries any other key or misses a required one. A task row holds one context per participant role, and the Environment Server sends each role’s context to that role’s session.

artifacts
dict[str, AgentContextArtifact] = Field(default_factory=dict)
model_config
= ConfigDict(extra='forbid', frozen=True)
values
dict[str, JsonValue] = Field(default_factory=dict)
nemo_gym.server_runtime.agent_context.AgentContext.fields() -> dict[str, pydantic.JsonValue | nemo_gym.server_runtime.agent_context.AgentContextArtifact]

Values and artifacts in one namespace, as an agent’s context model validates them.

class nemo_gym.server_runtime.agent_context.AgentContextArtifact()

Bases: BaseModel

A file or directory the agent reads, named by a path relative to a root the agent configures.

The content never travels in the seed. The agent resolves the path when it seeds the session, reads or stages the content when its turn runs, and releases anything it staged when the session closes or retires for a checkpoint.

model_config
= ConfigDict(extra='forbid', frozen=True)
path
str = Field(min_length=1)
nemo_gym.server_runtime.agent_context.AgentContextArtifact.require_relative_path(
path: str
) -> str
classmethod
nemo_gym.server_runtime.agent_context.AGENT_CONTEXT_KEY_NAME = 'agent_context'
nemo_gym.server_runtime.agent_context.AGENT_CONTEXT_MAX_BYTES = 64 * 1024