Skip to main content

Module model

Module model 

Source
Expand description

Message types, content blocks, and streaming events.

These types are the shared “wire format” used across the project:

  • Providers stream StreamEvent values that incrementally build an assistant reply.
  • Sessions persist Message values as JSON (see crate::session).
  • Tools return ContentBlock output that can be rendered in the TUI and replayed to providers.

Structs§

AssistantMessage
An assistant message.
Cost
Cost breakdown in dollars.
CustomMessage
A custom message injected by the host or extensions.
ImageContent
Image content block.
TextContent
Text content block.
ThinkingContent
Thinking/reasoning content block.
ToolCall
Tool call content block.
ToolResultMessage
A tool result message.
Usage
Token usage and cost tracking.
UserMessage
A user message.

Enums§

AssistantMessageEvent
Streaming event emitted for assistant message updates.
ContentBlock
A content block in a message.
Message
A message in a conversation.
StopReason
Why a response ended.
StreamEvent
Streaming event from a provider.
ThinkingLevel
Extended thinking level.
UserContent
User message content - either plain text or blocks.