An agent-side message with metadata.
Wraps Planck.AI.Message content parts with an id, timestamp, and metadata map.
Messages with a {:custom, atom()} role are UI-only and filtered out before the
context is sent to the LLM.
Summary
Functions
Build a new message with a generated id and current UTC timestamp.
Convert a list of agent messages to Planck.AI.Message structs.
Types
@type role() :: :user | :assistant | :tool_result | {:custom, atom()}
@type t() :: %Planck.Agent.Message{ content: [Planck.AI.Message.content_part()], id: non_neg_integer() | String.t(), metadata: map(), role: role(), timestamp: DateTime.t() }
Functions
@spec new(role(), [Planck.AI.Message.content_part()], map()) :: t()
Build a new message with a generated id and current UTC timestamp.
@spec to_ai_messages([t()]) :: [Planck.AI.Message.t()]
Convert a list of agent messages to Planck.AI.Message structs.
{:custom, :summary} messages are converted to :user so the LLM sees
compacted context. All other {:custom, _} messages are dropped.