> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# nemoguardrails.tracing.interaction_types

Core models for the tracing system.

## Module Contents

### Classes

| Name                                                                               | Description                                         |
| ---------------------------------------------------------------------------------- | --------------------------------------------------- |
| [`InteractionLog`](#nemoguardrails-tracing-interaction_types-InteractionLog)       | Detailed log about the execution of an interaction. |
| [`InteractionOutput`](#nemoguardrails-tracing-interaction_types-InteractionOutput) | Simple model for interaction output used in tracer. |

### Functions

| Name                                                                                           | Description                                                         |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [`extract_interaction_log`](#nemoguardrails-tracing-interaction_types-extract_interaction_log) | Extracts an `InteractionLog` object from an `GenerationLog` object. |

### API

```python
class nemoguardrails.tracing.interaction_types.InteractionLog()
```

**Bases:** `BaseModel`

Detailed log about the execution of an interaction.

**`activated_rails`** `List[ActivatedRail]`

---

**`events`** `List[dict]`

---

**`id`** `str`

---

**`trace`** `List[Union[SpanLegacy, SpanOpentelemetry]]`

---

```python
class nemoguardrails.tracing.interaction_types.InteractionOutput()
```

**Bases:** `BaseModel`

Simple model for interaction output used in tracer.

**`id`** `str`

---

**`input`** `Any`

---

**`output`** `Optional[Any]`

---

```python
nemoguardrails.tracing.interaction_types.extract_interaction_log(
    interaction_output: nemoguardrails.tracing.interaction_types.InteractionOutput,
    generation_log: nemoguardrails.rails.llm.options.GenerationLog,
    span_format: str = 'opentelemetry',
    enable_content_capture: bool = False
) -> nemoguardrails.tracing.interaction_types.InteractionLog
```

Extracts an `InteractionLog` object from an `GenerationLog` object.

**Parameters:**

**`interaction_output`** `InteractionOutput`

The interaction output

---

**`generation_log`** `GenerationLog`

The generation log

---

**`span_format`** `str` — default: 'opentelemetry'

Span format to use ("legacy" or "opentelemetry")

---

**`enable_content_capture`** `bool` — default: False

Whether to include content in trace events

---