# MessageData

> **Class** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/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[:8]}')(),
    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_expanded: bool = False,
    diff_file_path: str | None = None,
    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,
    is_streaming: 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[:8]}')(),
    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_expanded: bool = False,
    diff_file_path: str | None = None,
    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,
    is_streaming: 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_expanded` | `bool` |
| `diff_file_path` | `str \| None` |
| `skill_name` | `str \| None` |
| `skill_description` | `str \| None` |
| `skill_source` | `str \| None` |
| `skill_args` | `str \| None` |
| `skill_body` | `str \| None` |
| `skill_expanded` | `bool` |
| `is_streaming` | `bool` |
| `is_markdown` | `bool` |
| `height_hint` | `int \| None` |


## Properties

- `type`
- `content`
- `id`
- `timestamp`
- `tool_name`
- `tool_args`
- `tool_status`
- `tool_output`
- `tool_expanded`
- `diff_file_path`
- `skill_name`
- `skill_description`
- `skill_source`
- `skill_args`
- `skill_body`
- `skill_expanded`
- `is_streaming`
- `is_markdown`
- `height_hint`

## Methods

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

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/1ae053f347679e58562d2b81eb6d6e6e9bbf0b07/libs/cli/deepagents_cli/widgets/message_store.py#L94)