> This page is for version 0.6.0.
> For other versions, use one of these documentation indexes:
> - Main (default): https://docs.nvidia.com/nemo/gym/main/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo/gym/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo/gym/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo/gym/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo/gym/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo/gym/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo/gym/v0.3.0/llms.txt
> - 0.2.1: https://docs.nvidia.com/nemo/gym/v0.2.1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.

# nemo_gym.server_runtime.agent_context

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

## Module Contents

### Classes

| Name                                                                                  | Description                                                                                   |
| ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [`AgentContext`](#nemo_gym-server_runtime-agent_context-AgentContext)                 | Task data the agent's harness needs that is not part of the initial model input.              |
| [`AgentContextArtifact`](#nemo_gym-server_runtime-agent_context-AgentContextArtifact) | A file or directory the agent reads, named by a path relative to a root the agent configures. |

### Data

[`AGENT_CONTEXT_KEY_NAME`](#nemo_gym-server_runtime-agent_context-AGENT_CONTEXT_KEY_NAME)

[`AGENT_CONTEXT_MAX_BYTES`](#nemo_gym-server_runtime-agent_context-AGENT_CONTEXT_MAX_BYTES)

### API

```python
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)`

---

```python
nemo_gym.server_runtime.agent_context.AgentContext.check_keys_and_size() -> nemo_gym.server_runtime.agent_context.AgentContext
```

```python
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.

```python
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)`

---

```python
nemo_gym.server_runtime.agent_context.AgentContextArtifact.require_relative_path(
    path: str
) -> str
```

classmethod

```python
nemo_gym.server_runtime.agent_context.AGENT_CONTEXT_KEY_NAME = 'agent_context'
```

```python
nemo_gym.server_runtime.agent_context.AGENT_CONTEXT_MAX_BYTES = 64 * 1024
```