Skip to content

models

models

TextBlock dataclass

TextBlock(*, text: str = '')

A text content block from a transcript message.

ToolUseBlock dataclass

ToolUseBlock(
    *, name: str, input: RawDict = (lambda: {})(), id: str
)

A tool-use content block from a transcript message, containing the tool name and raw input.

ToolResult dataclass

ToolResult(
    *,
    tool_use_id: str,
    content: list[Any] | str = (lambda: [])(),
    is_error: bool = False,
    is_async: bool = False,
)

A tool-result content block linking back to its tool use via tool_use_id.

TaskNotification dataclass

TaskNotification(*, tool_use_id: str)

A parsed <task-notification> payload from a queue-operation message.

ToolUse dataclass

ToolUse(
    *,
    name: str,
    raw_input: RawDict = (lambda: {})(),
    id: str,
    result: ToolResult | None = None,
    message_index: int = -1,
)

A tool invocation extracted from the transcript, with typed input parsing, file/command access, and result linkage.

TranscriptMessage dataclass

TranscriptMessage(
    *,
    type: str,
    content: list[ContentBlock],
    raw: RawDict = (lambda: {})(),
)

A single message in a transcript with parsed content blocks, tool-use extraction, and text access.