> 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 full documentation content, see https://docs.nvidia.com/nemo/guardrails/llms-full.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.

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

**Bases:** `BaseModel`

Simple model for interaction output used in tracer.

```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:**

The interaction output

The generation log

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

Whether to include content in trace events