Canonical in-memory representation of a conversation.
Every provider normalises its wire format into this shape so the agent loop, tool-call parsers, and consumer code all speak the same dialect.
Summary
Functions
Build an assistant message (optionally with tool calls).
Turn a loose map/keyword into a Message. Tolerant of both string and atom
keys so provider JSON and user-constructed data both work.
Build a system message.
Build a tool-result message replaying the output of a tool call.
Build a user message.
Functions
@spec assistant(String.t() | nil, [ExAthena.Messages.ToolCall.t()] | nil) :: ExAthena.Messages.Message.t()
Build an assistant message (optionally with tool calls).
@spec from_map(map() | ExAthena.Messages.Message.t()) :: ExAthena.Messages.Message.t()
Turn a loose map/keyword into a Message. Tolerant of both string and atom
keys so provider JSON and user-constructed data both work.
@spec system(String.t()) :: ExAthena.Messages.Message.t()
Build a system message.
@spec tool_result(String.t(), String.t(), boolean() | nil) :: ExAthena.Messages.Message.t()
Build a tool-result message replaying the output of a tool call.
@spec user(String.t()) :: ExAthena.Messages.Message.t()
Build a user message.