A message in a conversation.
Messages have a :user or :assistant role and carry a list of content
blocks. There is no :tool role — tool results are Content.ToolResult
blocks inside user messages.
A UTC timestamp is assigned at construction unless explicitly set.
Summary
Functions
Creates a new message from a string, keyword list, or map.
Types
@type content() :: Omni.Content.Text.t() | Omni.Content.Thinking.t() | Omni.Content.Attachment.t() | Omni.Content.ToolUse.t() | Omni.Content.ToolResult.t()
Any content block that can appear in a message.
@type t() :: %Omni.Message{ content: [content()], private: map(), role: :user | :assistant, timestamp: DateTime.t() }
A conversation message.
Functions
@spec new(Enumerable.t() | String.t() | t()) :: t()
Creates a new message from a string, keyword list, or map.
A string is treated as a user message with that text as content. String
content is wrapped in a Text block. A timestamp is auto-assigned via
DateTime.utc_now/0 unless explicitly set.