# MessageData

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/tui/widgets/message_store/MessageData)

In-memory message data for virtualization.

This dataclass holds all information needed to recreate a message widget.
It is designed to be lightweight so that thousands of messages can be
stored without meaningful memory overhead.

## Signature

```python
MessageData(
    self,
    type: MessageType,
    content: str,
    id: str = (lambda: f'msg-{uuid.uuid4().hex}')(),
    timestamp: float = time(),
    tool_name: str | None = None,
    tool_args: dict[str, Any] | None = None,
    tool_status: ToolStatus | None = None,
    tool_output: str | None = None,
    tool_duration: float | None = None,
    tool_expanded: bool = False,
    tool_reject_reason: str | None = None,
    tool_diff_superseded: bool = False,
    tool_display_caveat: bool = False,
    tool_group_messages: list[MessageData] = list(),
    tool_group_expanded: bool = False,
    diff_file_path: str | None = None,
    diff_tool_name: str | None = None,
    diff_before_content: str | None = None,
    diff_after_content: str | None = None,
    diff_stats: DiffStats | None = None,
    diff_outcome: DiffOutcome = 'shown',
    diff_show_numbers: bool = True,
    diff_show_caveat: bool = True,
    skill_name: str | None = None,
    skill_description: str | None = None,
    skill_source: str | None = None,
    skill_args: str | None = None,
    skill_body: str | None = None,
    skill_expanded: bool = False,
    rubric_details: str | None = None,
    rubric_expanded: bool = False,
    reasoning_expanded: bool = False,
    user_expanded: bool = False,
    user_detect_mode: bool = True,
    is_streaming: bool = False,
    assistant_local_only: bool = False,
    is_markdown: bool = False,
    height_hint: int | None = None,
)
```

## Constructors

```python
__init__(
    self,
    type: MessageType,
    content: str,
    id: str = (lambda: f'msg-{uuid.uuid4().hex}')(),
    timestamp: float = time(),
    tool_name: str | None = None,
    tool_args: dict[str, Any] | None = None,
    tool_status: ToolStatus | None = None,
    tool_output: str | None = None,
    tool_duration: float | None = None,
    tool_expanded: bool = False,
    tool_reject_reason: str | None = None,
    tool_diff_superseded: bool = False,
    tool_display_caveat: bool = False,
    tool_group_messages: list[MessageData] = list(),
    tool_group_expanded: bool = False,
    diff_file_path: str | None = None,
    diff_tool_name: str | None = None,
    diff_before_content: str | None = None,
    diff_after_content: str | None = None,
    diff_stats: DiffStats | None = None,
    diff_outcome: DiffOutcome = 'shown',
    diff_show_numbers: bool = True,
    diff_show_caveat: bool = True,
    skill_name: str | None = None,
    skill_description: str | None = None,
    skill_source: str | None = None,
    skill_args: str | None = None,
    skill_body: str | None = None,
    skill_expanded: bool = False,
    rubric_details: str | None = None,
    rubric_expanded: bool = False,
    reasoning_expanded: bool = False,
    user_expanded: bool = False,
    user_detect_mode: bool = True,
    is_streaming: bool = False,
    assistant_local_only: bool = False,
    is_markdown: bool = False,
    height_hint: int | None = None,
) -> None
```

| Name | Type |
|------|------|
| `type` | `MessageType` |
| `content` | `str` |
| `id` | `str` |
| `timestamp` | `float` |
| `tool_name` | `str \| None` |
| `tool_args` | `dict[str, Any] \| None` |
| `tool_status` | `ToolStatus \| None` |
| `tool_output` | `str \| None` |
| `tool_duration` | `float \| None` |
| `tool_expanded` | `bool` |
| `tool_reject_reason` | `str \| None` |
| `tool_diff_superseded` | `bool` |
| `tool_display_caveat` | `bool` |
| `tool_group_messages` | `list[MessageData]` |
| `tool_group_expanded` | `bool` |
| `diff_file_path` | `str \| None` |
| `diff_tool_name` | `str \| None` |
| `diff_before_content` | `str \| None` |
| `diff_after_content` | `str \| None` |
| `diff_stats` | `DiffStats \| None` |
| `diff_outcome` | `DiffOutcome` |
| `diff_show_numbers` | `bool` |
| `diff_show_caveat` | `bool` |
| `skill_name` | `str \| None` |
| `skill_description` | `str \| None` |
| `skill_source` | `str \| None` |
| `skill_args` | `str \| None` |
| `skill_body` | `str \| None` |
| `skill_expanded` | `bool` |
| `rubric_details` | `str \| None` |
| `rubric_expanded` | `bool` |
| `reasoning_expanded` | `bool` |
| `user_expanded` | `bool` |
| `user_detect_mode` | `bool` |
| `is_streaming` | `bool` |
| `assistant_local_only` | `bool` |
| `is_markdown` | `bool` |
| `height_hint` | `int \| None` |


## Properties

- `type`
- `content`
- `id`
- `timestamp`
- `tool_name`
- `tool_args`
- `tool_status`
- `tool_output`
- `tool_duration`
- `tool_expanded`
- `tool_reject_reason`
- `tool_diff_superseded`
- `tool_display_caveat`
- `tool_group_messages`
- `tool_group_expanded`
- `diff_file_path`
- `diff_tool_name`
- `diff_before_content`
- `diff_after_content`
- `diff_stats`
- `diff_outcome`
- `diff_show_numbers`
- `diff_show_caveat`
- `skill_name`
- `skill_description`
- `skill_source`
- `skill_args`
- `skill_body`
- `skill_expanded`
- `rubric_details`
- `rubric_expanded`
- `reasoning_expanded`
- `user_expanded`
- `user_detect_mode`
- `is_streaming`
- `assistant_local_only`
- `is_markdown`
- `height_hint`

## Methods

- [`to_widget()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/message_store/MessageData/to_widget)
- [`from_widget()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/message_store/MessageData/from_widget)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/1425cf0b7c5e88bff8735778af82cf5c90564085/libs/code/deepagents_code/tui/widgets/message_store.py#L134)