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

# data\_designer.config.utils.trace\_renderer

## Module Contents

### Classes

| Name                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                    |
| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`TraceToolCallFunction`](#data_designerconfigutilstrace_renderertracetoolcallfunction) | dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = \{} for k, v in iterable: d\[k] = v dict(\*\*kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.  For example:  dict(one=1, two=2) |
| [`TraceToolCall`](#data_designerconfigutilstrace_renderertracetoolcall)                 | dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = \{} for k, v in iterable: d\[k] = v dict(\*\*kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.  For example:  dict(one=1, two=2) |
| [`TraceContentBlock`](#data_designerconfigutilstrace_renderertracecontentblock)         | dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = \{} for k, v in iterable: d\[k] = v dict(\*\*kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.  For example:  dict(one=1, two=2) |
| [`TraceMessage`](#data_designerconfigutilstrace_renderertracemessage)                   | dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = \{} for k, v in iterable: d\[k] = v dict(\*\*kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.  For example:  dict(one=1, two=2) |
| [`TraceRenderer`](#data_designerconfigutilstrace_renderertracerenderer)                 | Renders LLM conversation traces for display\_sample\_record.                                                                                                                                                                                                                                                                                                   |

### Functions

| Name                                                                                      | Description |
| ----------------------------------------------------------------------------------------- | ----------- |
| [`_extract_text_content`](#data_designerconfigutilstrace_renderer_extract_text_content)   | None        |
| [`_format_tool_call_args`](#data_designerconfigutilstrace_renderer_format_tool_call_args) | None        |
| [`_build_html_block`](#data_designerconfigutilstrace_renderer_build_html_block)           | None        |

### Data

[`logger`](#data_designerconfigutilstrace_rendererlogger)
[`_ROLE_STYLES`](#data_designerconfigutilstrace_renderer_role_styles)
[`_REASONING_LABEL_STYLE`](#data_designerconfigutilstrace_renderer_reasoning_label_style)
[`_REASONING_BODY_STYLE`](#data_designerconfigutilstrace_renderer_reasoning_body_style)
[`_TOOL_CALL_LABEL_STYLE`](#data_designerconfigutilstrace_renderer_tool_call_label_style)
[`_TOOL_CALL_BODY_STYLE`](#data_designerconfigutilstrace_renderer_tool_call_body_style)
[`RoleHtmlColor`](#data_designerconfigutilstrace_rendererrolehtmlcolor)
[`_ROLE_HTML_COLORS`](#data_designerconfigutilstrace_renderer_role_html_colors)

### API

```python
logger = getLogger(...)
```

```python
class data_designer.config.utils.trace_renderer.TraceToolCallFunction
```

**Bases**: `typing.TypedDict`

```python
name: str
```

```python
arguments: str
```

```python
class data_designer.config.utils.trace_renderer.TraceToolCall
```

**Bases**: `typing.TypedDict`

```python
id: str
```

```python
type: str
```

```python
function: data_designer.config.utils.trace_renderer.TraceToolCallFunction
```

```python
class data_designer.config.utils.trace_renderer.TraceContentBlock
```

**Bases**: `typing.TypedDict`

```python
type: str
```

```python
text: str
```

```python
class data_designer.config.utils.trace_renderer.TraceMessage
```

**Bases**: `typing.TypedDict`

```python
role: typing_extensions.Required[typing.Literal[system, user, assistant, tool]]
```

```python
content: typing_extensions.Required[list[data_designer.config.utils.trace_renderer.TraceContentBlock]]
```

```python
reasoning_content: str | None
```

```python
tool_calls: list[data_designer.config.utils.trace_renderer.TraceToolCall] | None
```

```python
tool_call_id: str | None
```

```python
_REASONING_LABEL_STYLE = italic bold medium_orchid1
```

```python
_REASONING_BODY_STYLE = italic medium_orchid1
```

```python
_TOOL_CALL_LABEL_STYLE = bold bright_yellow
```

```python
_TOOL_CALL_BODY_STYLE = bright_yellow
```

```python
RoleHtmlColor
```

```python
data_designer.config.utils.trace_renderer._extract_text_content(message: data_designer.config.utils.trace_renderer.TraceMessage) -> str
```

```python
data_designer.config.utils.trace_renderer._format_tool_call_args(raw_args: str) -> str
```

```python
class data_designer.config.utils.trace_renderer.TraceRenderer
```

Renders LLM conversation traces for display\_sample\_record.

```python
render_rich(
    traces: list[data_designer.config.utils.trace_renderer.TraceMessage],
    column_name: str
) -> rich.panel.Panel
```

Return a Rich Panel containing the formatted trace conversation.

```python
render_notebook_html(
    traces: list[data_designer.config.utils.trace_renderer.TraceMessage],
    column_name: str
) -> bool
```

Display HTML trace in Jupyter. Returns True if displayed, False otherwise.

```python
data_designer.config.utils.trace_renderer._build_html_block(
    title: str,
    body: str,
    bg_color: data_designer.config.utils.trace_renderer.RoleHtmlColor,
    *,
    escape_body: bool = True
) -> str
```